Repository navigation
feat(ifc): every port takes Revit's flow direction, name and description, from its connector's family parameters and calculation (#834) (RE-212) - #929
Merged
Conversation
…ion, from its connector's family parameters and calculation (#834) (RE-212) A family instance's HVAC or piping connector takes the Flow Direction its family sets in the connector's own FamilyParams (-1140248 piping, -1140219 HVAC), or where the family leaves it bidirectional, the m_eDirection of the instance connector's calculation; a duct's or pipe's connector takes its SegmentConnectorCalculation's; a bidirectional connector joined to one with a direction takes the opposite. 463 of 463 ports on RE1 Plumbing, Mechanical and Electrical. Ports are named InPort_/OutPort_/Port_ by their direction and described Flow, as revit-ifc writes them.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7176baa4e3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…Port_ names too (RE-212)
DrunkOnJava
enabled auto-merge (squash)
October 23, 2026 19:11
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.
Summary
Every port rvt-rs writes now takes Revit's flow direction, its name and its description. RE-212 finds the direction in the file:
FamilyParams;A bidirectional end joined to a directed connector takes the opposite. Measured on 463 of 463 ports of RE1 Plumbing, Mechanical and Electrical.
Motivation
#834. rvt-rs wrote
NOTDEFINEDon all 408 HVAC and piping ports of the RE1 models (RE-197 had found no field). FlowDirection matched on 1 of 260 and 1 of 150 inports_vs_ifc. The direction also sets a port's axis: Revit points a sink into its element, and the writer already does that for a sink (#847).Changes
src/native_connectors.rs:connector_portsreplacessymbol_port_indices. In one pass it reads instances, symbols, families and the ducts and pipes. It returns each family-instance port's domain and flow direction (port_flow_direction), and each segment connector's calculated direction. The pieces:family_flow_directions: a family's cells, ordered by theirm_oRelevantParams, own theFamilyParamsthat follow them in the same order; it reads -1140248 (piping) or -1140219 (HVAC) there. If the counts differ, it reads nothing.calculated_directions: reads theMEPFamilyConnectorCalculation*orSegmentConnectorCalculationobjects whosem_pConnectortoken names aConnector.src/ifc/mod.rs:attach_family_instance_portsgives the existing duct and pipe ports their direction, then pushes the family-instance ports.apply_partner_directionsturns a bidirectional duct, pipe or fitting port joined to a directed one to the opposite direction.src/ifc/step_writer.rs: a port is namedInPort_,OutPort_orPort_by its direction, and describedFlow(revit-ifcConnectorExporter).tests/family_instance_ports.rs:ports_have_revits_flow_directionschecks every port both exports hold for Revit's prefix andFlowDirection.examples/probe_re212_connector_data.rs,tools/re/port_directions_vs_ifc.pyandreports/element-framing/RE-212-port-flow-directions.md. The report corrects RE-197's negative: it had compared the family's ownFamilyParams, not each connector's.CHANGELOG.md.Testing
CI runs the new check in tier 2 (
RVT_PROJECT_CORPUS_DIR, RE1). A Measure run againstmainwith the probe and scorer follows on this PR, and itsports_vs_ifcandport_places_vs_ifcshow rvt-rs's own ports.tools/check-local.shpasses: left to CIAudit-honesty checklist
SystemType(RE1 is IFC2X3) and the electricalFlow=descriptionLegal and contribution hygiene
Contributor declaration (CLEANROOM.md): the findings in this PR are based on byte observations of the RE1 models through the file's own schema (sources 1 to 3) and on revit-ifc read for how its exporter names and directs a port (
ConnectorExporter, source 5). I have not used Autodesk SDK source, ODA SDK source, leaked internal documentation, NDA material, or decompiled internal Revit implementation code beyond public symbol exports, and I have not copied or translated code from revit-ifc.Breaking changes
native_connectors::symbol_port_indicesandport_flow_direction_of_domain, underrvt::research(unstable), are replaced byconnector_portsandport_flow_direction. Exported port names change fromPort_toInPort_/OutPort_where a direction is read.Related issues
Refs #834 (direction and description;
SystemTypestays open), #869 (axes of placed ports)