Skip to content

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
DrunkOnJava merged 4 commits into
mainfrom
feat/834-port-directions
Oct 23, 2026
Merged

DrunkOnJava merged 4 commits into
mainfrom
feat/834-port-directions

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

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:

  • a family's connector holds it in its own FamilyParams;
  • an instance's connector holds a calculated direction, which counts where the family leaves the connector bidirectional;
  • a duct's or pipe's connector holds its own calculated direction.

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 NOTDEFINED on 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 in ports_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_ports replaces symbol_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 their m_oRelevantParams, own the FamilyParams that follow them in the same order; it reads -1140248 (piping) or -1140219 (HVAC) there. If the counts differ, it reads nothing.
    • calculated_directions: reads the MEPFamilyConnectorCalculation* or SegmentConnectorCalculation objects whose m_pConnector token names a Connector.
  • src/ifc/mod.rs:
    • attach_family_instance_ports gives the existing duct and pipe ports their direction, then pushes the family-instance ports.
    • apply_partner_directions turns a bidirectional duct, pipe or fitting port joined to a directed one to the opposite direction.
  • src/ifc/step_writer.rs: a port is named InPort_, OutPort_ or Port_ by its direction, and described Flow (revit-ifc ConnectorExporter).
  • tests/family_instance_ports.rs: ports_have_revits_flow_directions checks every port both exports hold for Revit's prefix and FlowDirection.
  • examples/probe_re212_connector_data.rs, tools/re/port_directions_vs_ifc.py and reports/element-framing/RE-212-port-flow-directions.md. The report corrects RE-197's negative: it had compared the family's own FamilyParams, not each connector's.
  • CHANGELOG.md.

Testing

CI runs the new check in tier 2 (RVT_PROJECT_CORPUS_DIR, RE1). A Measure run against main with the probe and scorer follows on this PR, and its ports_vs_ifc and port_places_vs_ifc show rvt-rs's own ports.

model family instances ducts and pipes opposite their partner all ports
RE1 Plumbing 136 of 136 124 of 124 0 260 of 260
RE1 Mechanical 88 of 88 59 of 59 3 of 3 150 of 150
RE1 Electrical 53 of 53 none 0 53 of 53
  • tools/check-local.sh passes: left to CI
  • Verified on real files: RE1 (Drshelden/IFC-ECS, MIT) with Revit's own exports. The rule is measured from Measure run 40004442760's probe output.
  • Witness verdicts: port names change, and the observations hash entity counts, relations and storeys, so the IFC hashes in Measure move but the verdicts' surfaces should not. The Measure run will show it.
  • N/A: performance. The family pass now also reads the instances and segments. Measure's timings will show the cost.

Audit-honesty checklist

  • Docs reflect the state after this PR (CHANGELOG, RE-212)
  • Limitation resolved: HVAC and piping port directions
  • Still open and stated: SystemType (RE1 is IFC2X3) and the electrical Flow= description
  • Commit messages say what and why
  • No emojis
  • No private paths
  • Probe, report and scorer included

Legal and contribution hygiene

  • Apache-2.0
  • No Autodesk proprietary content
  • No new fixtures

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_indices and port_flow_direction_of_domain, under rvt::research (unstable), are replaced by connector_ports and port_flow_direction. Exported port names change from Port_ to InPort_/OutPort_ where a direction is read.

Related issues

Refs #834 (direction and description; SystemType stays open), #869 (axes of placed ports)

…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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/ifc/step_writer.rs Resolved
@DrunkOnJava
DrunkOnJava merged commit c435589 into main Oct 23, 2026
27 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/834-port-directions branch October 23, 2026 20:21
Repository owner deleted a comment from chatgpt-codex-connector Bot Oct 31, 2026
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