Repository navigation
feat(ifc): a family instance written as a proxy has its ports, nested in it (B83) - #705
Merged
Merged
Conversation
…ests them (B83) Revit's export of RE1 Electrical writes 30 of its 53 ports on elements both it and rvt-rs write as proxies. IFC4 ties a port to a distribution element only through IfcRelConnectsPortToElement, and Revit's own IFC4 export nests every port in its element with an IfcRelNests. For every port Revit writes on an element rvt-rs writes as an IfcBuildingElementProxy, rvt-rs must write the port Port_<ElementId>_<index>, nested in that element. Red on draft #704, Corpus health run 37299353664: RE1-Electrical.rvt: 0 of Revit's 30 ports on proxies written, nested in their element RE1-Plumbing.rvt: 0 of Revit's 0 ports on proxies written, nested in their element RE1-Mechanical.rvt: 0 of Revit's 6 ports on proxies written, nested in their element thread 'proxies_have_revits_ports_nested' panicked at tests/proxy_ports.rs:171:5: RE1-Electrical.rvt: 30 of Revit's 30 ports on family instances rvt-rs writes as proxies are not written nested in their element; first: [(428352, 1), (476276, 1), (476469, 1), (476602, 1), (477108, 1), (477740, 1), (477846, 1), (477893, 1)] RE1-Mechanical.rvt: 6 of Revit's 6 ports on family instances rvt-rs writes as proxies are not written nested in their element; first: [(427568, 6), (427568, 7), (427568, 8), (427568, 9), (427568, 10), (427568, 11)] test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.49s
… in it (B83)
Revit's export of RE1 Electrical writes 30 of its 53 ports on elements both
it and rvt-rs write as proxies (panels, receptacles, switches, junction
boxes, sensors). rvt-rs gave ports to distribution elements only, as it ties
each with an IfcRelConnectsPortToElement, which IFC4 restricts to
distribution elements. Revit's own IFC4 export (revit-ifc ConnectorExporter)
nests every port in its element with an IfcRelNests named NestedPorts.
- attach_family_instance_ports gives a proxy a port per symbol connector,
as it does a distribution element (RE-169).
- The writer nests a proxy's ports in it, one IfcRelNests per proxy
('NestedPorts', 'Flow'); every other port keeps its
IfcRelConnectsPortToElement.
- tools/re/ports_vs_ifc.py reads nested ports as tied to their element.
This was referenced Oct 5, 2026
Closed
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.
B83, the remainder of B54 (#528). In Revit's export of RE1 Electrical, 30 of the 53 ports sit on elements that both Revit and rvt-rs write as proxies: panels, receptacles, switches, junction boxes and sensors. RE1 Mechanical has 6 such ports, all on one element (427568). rvt-rs gave ports only to distribution elements, because it ties each port with
IfcRelConnectsPortToElement, which IFC4 restricts to distribution elements. Revit's own IFC4 export (revit-ifcConnectorExporter) usesIfcRelNestsinstead and nests every port in its element.attach_family_instance_portsnow gives a proxy one port per symbol connector, the same way it treats a distribution element (RE-169).IfcRelNestsper proxy ('NestedPorts','Flow', as revit-ifc names it). Every other port keeps itsIfcRelConnectsPortToElement.tools/re/ports_vs_ifc.pycounts nested ports as tied to their element.Red/green.
tests/proxy_ports.rsfailed on draft #704 (Corpus health run 37299353664) with 30 of 30 missing on Electrical and 6 of 6 on Mechanical. The failing output is in the test commit.Measure (run 37299621824, this branch's scorers on both sides):
Only those two models' IFC and port scores change. Their diagnostics change only in
total_entities(229 to 259 and 528 to 534). The other 145 outputs are identical.To follow (B84, which needs the maintainer's approval): nest every port the way Revit's IFC4 export does. That would change how the existing
family_instance_portsandduct_and_pipe_portstests read ties.Note
Medium Risk
Changes IFC topology for proxy-hosted MEP connectors (new ports and nesting relationships); behavior is scoped to proxies but affects port counts and schema relationships on real corpus models.
Overview
B83 extends connector port export to family instances written as
IfcBuildingElementProxy, matching Revit’s IFC4 pattern whereIfcRelConnectsPortToElementis not valid for proxies.Export model:
attach_family_instance_portsnow attaches symbol connector ports to proxies the same way it does for distribution elements, so electrical/mechanical fixtures (panels, receptacles, etc.) get the ports Revit’s reference IFC expects.STEP writer: Ports on proxy hosts are grouped and linked with
IfcRelNests(NestedPorts/Flow) instead ofIfcRelConnectsPortToElement; distribution elements keep the existing port-to-element relationships. JoinIfcRelConnectsPortsbehavior is unchanged.Validation: New corpus test
proxy_portscompares nested proxy ports against Revit’sRE1-*.ifc; CI includesreal proxy_ports. Research scorerports_vs_ifc.pytreatsIfcRelNestsas the port-to-element tie for proxies.Reviewed by Cursor Bugbot for commit f8d28c3. Configure here.