Repository navigation
red: B54 family-instance ports (scratch, do not merge) - #678
Closed
DrunkOnJava wants to merge 1 commit into
Closed
DrunkOnJava wants to merge 1 commit into
DrunkOnJava wants to merge 1 commit into
Conversation
…s Revit's export writes them (B54)
Owner
Author
|
Red draft for B54's family-instance ports; its run (37230564190) is recorded in the rebuilt PR's test commit. |
DrunkOnJava
added a commit
that referenced
this pull request
Oct 4, 2026
…ectors, joined or not (B54) (#680) #528. A FamilySymbol's native record lists its connectors (m_arrConnectorData, each an m_index); its Family holds a ConnectorDataCell per connector with its domain. On RE1 Electrical, Plumbing and Mechanical every family instance Revit writes ports for has exactly its symbol's connector indices, the cable tray and conduit ones aside (Measure run 37230166352). rvt-rs wrote ports only for the joins it read. native_connectors::symbol_port_indices reads them through the native record path (2023 to 2027), and the export gives each family instance written as a distribution element a port per connector; the writer skips one a join already gave. Red on draft #678 (run 37230564190): Electrical 0 of 23, Plumbing 128 of 136, Mechanical 78 of 82; the output is in the test commit. Electrical's 30 proxies keep no ports: IFC4 lets a port be tied only to a distribution element. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Adds a native-record dependency on the IFC export path and expands port emission for MEP family instances; failures are mostly silent (no ports) but wrong connector filtering could mismatch Revit’s IFC. > > **Overview** > **B54 (#528)** extends IFC export so **family instances** written as distribution elements get an `IfcDistributionPort` for each symbol connector Revit would export—not only connectors that appear in join records (ducts/pipes already got ports 0 and 1). > > A new **`native_connectors`** module reads `FamilySymbol` / `Family` native records via `native_document::extract`, maps connector indices to domains, and keeps HVAC, electrical, and piping connectors (excludes cable tray and conduit). **`attach_family_instance_ports`** runs late in the export pipeline, looks up each distribution building element’s type symbol, and pushes `IfcEntity::Port` rows; the STEP writer still **skips** ports a `PortConnection` already created. If native records cannot be read for the file release, behavior falls back to join-only ports. > > Docs on `IfcEntity::Port` and **`is_distribution_element`** (now `pub(crate)`) are updated. A corpus integration test **`family_instance_ports`** compares exported ports to Revit’s RE1 Electrical/Plumbing/Mechanical IFC references for distribution-entity family instances. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 59ebdf3. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Red run for B54's family-instance ports test; the implementation lands in a rebuilt PR.
Note
Low Risk
Test and CI target registration only; no exporter or library behavior changes in this diff.
Overview
Adds B54 (#528) coverage for family-instance
IfcDistributionPortexport: for RE1 Electrical, Plumbing, and Mechanical, every Revit reference port on elements rvt-rs maps to distribution IFC types must appear asPort_<ElementId>_<index>and be tied to that element’sTagviaIfcRelConnectsPortToElement(duct/pipe ports stay induct_and_pipe_ports).The new
family_instances_have_revits_portstest exports each availableRE1-*.rvtwithRvtDocExporter, parses STEP like the duct/pipe test, filters reference ports to the nine supported distribution entity kinds, and fails on missing or mis-linked ports. It usesRVT_PROJECT_CORPUS_DIR, skips absent models, and registersfamily_instance_portsas a real CI target intools/ci/test-targets.txt.Per the PR note, this is a red-run scaffold—the exporter behavior is expected to land in a follow-up PR.
Reviewed by Cursor Bugbot for commit aeca703. Configure here.