Skip to content

red: B54 family-instance ports (scratch, do not merge) - #678

Closed
DrunkOnJava wants to merge 1 commit into
mainfrom
red/b54-instance-ports
Closed

DrunkOnJava wants to merge 1 commit into
mainfrom
red/b54-instance-ports

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

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 IfcDistributionPort export: for RE1 Electrical, Plumbing, and Mechanical, every Revit reference port on elements rvt-rs maps to distribution IFC types must appear as Port_<ElementId>_<index> and be tied to that element’s Tag via IfcRelConnectsPortToElement (duct/pipe ports stay in duct_and_pipe_ports).

The new family_instances_have_revits_ports test exports each available RE1-*.rvt with RvtDocExporter, 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 uses RVT_PROJECT_CORPUS_DIR, skips absent models, and registers family_instance_ports as a real CI target in tools/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.

@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Red draft for B54's family-instance ports; its run (37230564190) is recorded in the rebuilt PR's test commit.

@DrunkOnJava DrunkOnJava closed this Oct 4, 2026
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 -->
@DrunkOnJava
DrunkOnJava deleted the red/b54-instance-ports branch October 18, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant