Skip to content

feat(ifc): pipes take their type, cylinder and ports from their own record on Revit 2015 to 2027 (#1190) (RE-370) - #1523

Merged
DrunkOnJava merged 2 commits into
DrunkOnJava:mainfrom
puzzbobb:survey-1190-s10
Nov 8, 2026
Merged

DrunkOnJava merged 2 commits into
DrunkOnJava:mainfrom
puzzbobb:survey-1190-s10

Conversation

@puzzbobb

@puzzbobb puzzbobb commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A pipe's own native record (RbsPipeCurve) gives it its type, the cylinder it is drawn as, and its two ports with their places and flow directions, on every release from 2015 to 2027. On 2015 to 2023 that is every pipe; on 2026 and 2027, which RE-131's connector entries don't read, every pipe; on 2024 and 2025 the pipes those entries miss. The record's line and diameter give Revit's own export on 93 of 93 pipes (RE1 Plumbing and Mechanical, the BIM4LCA office). It's a tenth slice of #1190, on main, not stacked on the other slices, and closes the pipe half of #869's "outside 2024 and 2025".

Motivation

Changes

  • src/research/partition_schema_mvp/mep.rs: attach_native_pipes. One projected native pass (graph_fields, Revit 2015–2023 exports: the remaining time against 0.11.0 after #1237 #1335) over the pipes still without a type or body and the file's RbsPipeType records. From each pipe's record: its type (m_idType, named by the RbsPipeType's SymbolInfo.m_name, RE-240's rule), its one GLine between its end parameters, half its m_dOuterDiameter, which Connector is at each end (SegmentConnectorPosition.m_paramOnCurve) and each connector's calculated direction (SegmentConnectorCalculation.m_eDirection, RE-212's numbering). It writes the fields RE-131 and RE-240 write, so the family, cylinder, quantities, vertical invert and ports come from the existing export code. The cylinder must pass RE-131's own box test (partition_pipe_axes::pipe_body), and a value is written only where every copy of the record agrees. The inner diameter isn't written: a level pipe's invert stays on 2025, where RE-157 measured it.
  • attach_pipe_axes calls it on 2026 and 2027 instead of returning, and on 2024 and 2025 after RE-131's bodies and before the end keys (a pipe keyed from its record keeps those keys). The 2015 to 2023 branch calls it after its records are recovered. Because on 2024 to 2027 it runs before RE-130's and RE-134's byte scans, a pipe's type name there is its record's.
  • src/research/partition_schema_mvp/fields.rs: NATIVE_PIPE_REVIT_VERSIONS (2015 to 2027), PIPE_FLOW_DIRECTIONS_FIELD.
  • src/ifc/export_content.rs: a pipe's port takes its flow direction from PIPE_FLOW_DIRECTIONS_FIELD where the record gave it; on 2023 and later the connector pass sets the same value afterwards, as before.
  • probes/examples/probe_re370_pipes.rs (each pipe as the export draws it; with --native, each pipe's record alone), tools/re/pipes_vs_ifc.py, reports/element-framing/RE-370-native-pipes.md, an addendum to docs/format-reconnaissance.md, docs/status.md, docs/evidence.md, docs/supported-profile.md, changelog.d/added/1190-2015-2023-pipes.md.

Testing

Unit tests are banned in this repository: do not add them. Show the change working end to end on real files instead.

  • tools/check-local.sh passes (fmt, clippy, rustdoc, build, real-file / CLI / contract checks)
    • tools/check-local.sh --corpus on the local corpus: every step passes, including the 301 real-file tests and the MCP server's 15 end-to-end tests. cargo +1.87 check --all-targets (MSRV) is clean.
  • Verified end to end on real Revit files: the command, the files (and their licence), and the measured result against Revit's own export are in the PR body, with the script or probe that reproduces it
    • Against Revit's own export (2024 and 2025), probe_re370_pipes --native and tools/re/pipes_vs_ifc.py, each pipe's record alone: RE1 Plumbing 63 of 63 and RE1 Mechanical 6 of 6 with Revit's Length (MIT, magnetar-io/revit-test-datasets, IFC2X3, which writes no areas), and the BIM4LCA office as built and at building permit 12 of 12 each with Revit's Length, OuterSurfaceArea and GrossCrossSectionArea (local only). 93 of 93 pipes; every vertical pipe's invert, 47 of 47. RE-131 places all 93 already, so those exports don't change; they measure the record's rule where Revit's answer is known. With RE-131's entries switched off in a throwaway local build, the record's connectors place RE1 Plumbing's 124, RE1 Mechanical's 62 and the office's 24 pipe ports within 0.01 ft of Revit's with Revit's axis, as RE-131's keys do.
    • Not against a Revit export on 2015 to 2023, 2026 or 2027: none I have holds a pipe. Held to the same Autodesk MEP samples saved by 2024 (pinned in research/autodesk-sample-projects.tsv, fetched, never stored), which can't catch an error that save shares. Against main's export of the 2024 save, over the twelve MEP saves of 2015, 2019 and 2024 to 2027: 93,987 pipe values equal, 3 different, all of pipe 727577, which the 2015 save's own record shows edited (another diameter and length). Every pipe has the 2024 save's name, type, family and Type Id, and its Length and areas to 0.01 %; each body's world box is the 2024 save's to 1 mm. Two 2015 pipes whose record diameters are 0 keep their boxes.
    • Ports, against the 2024 save by name: on 2015, 2019 and 2025 to 2027 every pipe port (982 on rme_basic, 976 on rme_advanced) has the 2024 save's point, axis and flow direction, but five on 2015's rme_basic (the zero-diameter and edited pipes). Before, 2019's had no direction and 475 pointed out of their pipe where 2024's point in, and none of 2027's was placed. On 2027 the fitting ports joined to them are now placed too (974 and 968), each at the 2024 save's point, axis and direction.
    • Against main: 45 of 58 sample saves (Autodesk's 53 of 2015 to 2027 and Snowdon Towers' five of 2024) export byte for byte as before. On the 13 that change (the MEP saves and 2024 Snowdon Plumbing, whose 60 pipes RE-131 missed) every product but a pipe keeps its class, Tag, GlobalId, name, storey and every property set; the ports that change are the pipes' and, on 2024 to 2027, the ports joined to them. Of 206 local project files of 2008 to 2027, 194 export IFC and diagnostics byte for byte as main does (SOURCE_DATE_EPOCH=1700000000), RE1 and the office among them; the 12 that change all hold pipes, and on each only pipes and ports change.
    • Against Revit 2018's own export (the two Vitoria projects, IFC2X3, counts only, maintainer's Measure 42518201407): Qto_PipeSegmentBaseQuantities.Length 149 of 149 and 140 of 140 equal, none different; Pset_PipeSegmentTypeCommon.Reference 149 of 151 and 140 of 142; record-box IfcPipeSegment 151 to 2. That export holds no Pset_PipeSegmentOccurrence.InvertElevation, so values Revit doesn't write go from 18 to 62 and from 20 to 65; an IFC2X3 export is counted apart and removes no value.
    • One name change on a 2025 file: on Golden Nugget's building services 278 pipes' type names change, 272 of one type and 6 of another, from a wrong name to the type's own. The Type Id is unchanged; the new name is the type's own RbsPipeType record's. No Revit export of that file is at hand.
  • If this touches the IFC exporter: the witness verdicts replay (see CONTRIBUTING.md) or the changed observations are refreshed in this PR
    • Core Interior (2024) has no pipes and exports byte for byte as before, so its observations are unchanged.
  • If this is a performance change: reran tools/bench.sh and attached the before / after
    • N/A. No slower: 4.29 s on main and 4.35 s here on rme_basic 2019 (within noise), 15.3 s and 14.7 s on rme_basic 2027, 30.9 s and 29.7 s on Golden Nugget's building services, 3.81 s on both for a file with no pipe.
tools/fetch-autodesk-samples.sh samples 2015 2027
cargo run --profile ci -p rvt-probes --example probe_re370_pipes -- samples/2019-rme_basic_sample_project.rvt > 2019.txt
cargo run --profile ci -p rvt-probes --example probe_re370_pipes -- samples/2024-rmebasicsampleproject.rvt > 2024.txt
diff 2019.txt 2024.txt
cargo run --profile ci -p rvt-probes --example probe_re370_pipes -- --native _project_corpus/Revit/RE1-Plumbing.rvt > native.txt
python3 tools/re/pipes_vs_ifc.py native.txt _project_corpus/Revit/RE1-Plumbing.ifc

Audit-honesty checklist

  • README / docs reflect the current state after this PR — no claims of features that are not actually shipped in this PR
  • A user-visible change has its entry as a fragment under changelog.d/<section>/ (see changelog.d/README.md), not in CHANGELOG.md
  • If a limitation was resolved, the "Known limitations" / "What works today" section in the relevant docs is updated
    • docs/status.md, docs/evidence.md (the 2024 and 2025, 2026 and 2023 rows), docs/supported-profile.md.
  • If a new limitation was introduced, it is documented in the PR body and in-code
  • Commit messages describe WHAT changed and WHY, not "fix things" or "updates"
  • No emojis in code, docs, or commit messages
  • No private paths, personal email addresses, or internal jargon in committed files
  • If this is a reverse-engineering finding: a reproducible probe under probes/examples/ and a dated addendum to docs/format-reconnaissance.md are included
    • probes/examples/probe_re370_pipes.rs, tools/re/pipes_vs_ifc.py.

Legal and contribution hygiene

  • I agree this work is licensable under Apache-2.0 (see CONTRIBUTING.md)
  • This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content (see CLEANROOM.md)
  • Any new test fixtures use synthetic values (testuser, 111111, FY-20XX, etc.) and contain no real-world PII
    • No fixtures.

Breaking changes

None. Two new public constants and one new public function (pipe_flow_directions_from_fields); existing names and types are unchanged.

Screenshots or output samples

rme_basic, pipe 513756, as the export writes it:

2019 before  IfcPipeSegment 'Pipe-513756'                  box body, no quantities, ports unplaced
2019 after   IfcPipeSegment 'Pipe Types:Standard:513756'   cylinder, Length 4.738869 m, GrossCrossSectionArea 0.032429 m², OuterSurfaceArea 3.025159 m²
2027 before  IfcPipeSegment 'Pipe Types:Standard:513756'   box body, no quantities, ports unplaced
2027 after   as 2019 after
2024 save    the same values

Related issues

Refs #1190, #869, #96, #1521, #1522

Notes

This, #1521 and #1522 all add a clause to the 2023 rows of docs/evidence.md and docs/supported-profile.md, a line to docs/status.md and an addendum at the end of docs/format-reconnaissance.md, so whichever merges later has a small text conflict there. The code doesn't overlap.

puzzbobb and others added 2 commits November 8, 2026 17:09
…ecord on Revit 2015 to 2027 (DrunkOnJava#1190) (RE-370)

On Revit 2015 to 2023 a pipe was written with no type and its record box as
its body, so it had no Family, Type or type Reference, no
Qto_PipeSegmentBaseQuantities, no invert and unplaced ports: 491 pipes on
rme_basic and 488 on rme_advanced. On 2026 and 2027 every pipe was its box,
because RE-131's connector entries are measured on 2024 and 2025 only
(DrunkOnJava#869), and on those two releases the entries leave some pipes unplaced (35
and 36 on the samples, 49 to 172 on local 2025 files). On 2015 to 2022 a
pipe's ports had no flow direction.

A pipe's own RbsPipeCurve record holds all of it on every release from 2015
to 2027: its type in m_idType (an RbsPipeType named by its SymbolInfo,
RE-240's rule), its centreline as its one GLine between its two end
parameters, its outer diameter in its PipeDomainDesignPropertyManager, which
Connector sits at each end (SegmentConnectorPosition.m_paramOnCurve) and the
direction Revit calculated for each (SegmentConnectorCalculation).
attach_native_pipes reads them in one projected pass for every pipe still
without a type or a body (on 2015 to 2023 and 2026 to 2027 every pipe, on
2024 and 2025 those RE-131's entries do not place) and writes the fields
RE-131 and RE-240 write, so the family, cylinder, quantities, vertical
invert and ports come from the same export code. The cylinder is held to
RE-131's box test, and a value is written only where every copy of the
record agrees. A level pipe's invert stays on 2025 only, where RE-157
measured it. On 2024 to 2027 the read runs before RE-130's and RE-134's
byte scans name a pipe's type, so the type's name is its record's: on
Golden Nugget's building services (2025) that renames 278 pipes from a flex
duct's name and a stray character to their RbsPipeType's names, and no
other file's pipe names change.

The record's line and diameter give Revit's own export on 93 of 93 pipes of
RE1 Plumbing and Mechanical (2025) and the BIM4LCA office (2024): Length,
and a vertical pipe's invert on 47 of 47. On Autodesk's twelve MEP sample
saves of 2015 to 2027, against the 2024 save, 93,987 pipe values are equal
and 3 differ, all of one pipe the project edited between the saves, and
every pipe port has the 2024 save's place, axis and flow direction but those
of three 2015 pipes. Nothing but pipes and the ports joined to them changes
in the export.
@DrunkOnJava
DrunkOnJava merged commit 1e2d3de into DrunkOnJava:main Nov 8, 2026
36 checks passed
DrunkOnJava added a commit that referenced this pull request Nov 9, 2026
## Summary

Release 0.16.0:
- Revit 2015 to 2023 projects: beams along their location lines (#1509,
RE-362), walls joined by their join lists and angled walls along their
lines (#1517, RE-364), `Phase Created` (#1521, RE-368), `Constraints`
Level parameters (#1522, RE-369), pipes with their type, cylinder and
ports (#1523, RE-370), and Revit 2015 files following the export phase
(#1332, RE-372).
- Revit 2026 and 2027 projects: beams, stair runs, tread landings and
sketch outlines (#1426, RE-341), and pipes, ports, door and window cuts
and the 2025 properties (#1454, RE-346). Revit 2025 beams, tread
landings and sketch arcs (#1440, RE-345); shaft cuts on 2024 only.
- Spaces: Areas of Revit 2025 to 2027 (#1428), `rac_advanced`'s Areas
from Revit's plan topology (#1261, #1434), `SpaceKind` on every
`IfcSpace` (#1437), and the room phase fallback (#1359).
- Doors and windows: Revit's placement axes (#1447, RE-347), a door in
no wall at its stored origin (#1494, RE-361), and both flips decoded
(#1357, RE-343).
- Values Revit's export writes: wall-cut openings (#1165, RE-338),
`FireRating` and `Manufacturer` (#1185, RE-354), cut column quantities
(#1203, RE-353), Furniture Systems (#1444, RE-352), and a plumbing
fixture that draws nothing left out (#1496, RE-363).
- Walls: hosts of embedded curtain walls from their saved mesh (#1385,
RE-340), profile-edited ends, bases and cut-outs (#1396, #1410, #1411,
#1473), previous location lines (#1475, RE-360), and floor voids tagged
as Revit tags them (#1408, RE-355).
- The writer: IFC4 EXPRESS rules held (#1430), non-finite numbers
refused (#1559); the diagnostics, elements CSV, viewer panels and MCP
server count and place what the IFC writes (#1327, #1417, #1422, #1424);
export memory restored (#1429).
- The viewer's saved parameters panel (#35, RE-207); the provenance
table's new sources (#1368, #1498); the native readers' speed-ups
(#1335); release tag preflight and attested wheels (#1457, #1466);
measured numbers named by model (#1192); Measure's semantic diff
(#1334).

## Changes

- Version 0.15.0 -> 0.16.0 in:
  - Cargo.toml;
  - rvt-py/Cargo.toml and its `=` pin;
  - rvt-mcp/Cargo.toml and its `=` pin;
  - rvt-wasm/Cargo.toml;
  - tools/stream_evidence/Cargo.toml;
  - viewer/package.json;
  - CITATION.cff (version and date);
  - Cargo.lock and fuzz/Cargo.lock.
- `python3 tools/release/changelog.py assemble`: 56 fragments go into
`[0.16.0]`, with an introduction, a "Not measured" paragraph, credits
and "Upgrading from 0.15".
- README: the latest release and the "Upgrading from" pointer.

## Testing

- **Measure 42555357168**, `main` at 9c66e9b against v0.15.0,
unfiltered with timing: the reference models, the BIM4LCA office, Revit
2025, Autodesk's samples of every release, the held-out models,
`rac_advanced`'s IFC2X3 pairs and BIMcollab, 118 exports (no families).
Every figure in the "Measured against 0.15.0" paragraph is from it:
  - 97 exports move and 21 do not;
- no property value or quantity goes from equal to different or missing
on any model;
  - the IFC4 rules check finds nothing on all 118;
  - the `same-project gates` check passes on 9c66e9b;
- time is 1.015 in total over 68 files, and peak memory 0.54 to 1.29
times 0.15.0's.
- Since 9c66e9b this branch adds only the version strings, the
changelog and the witness and fixture refresh.
- `python3 tools/ci/release_preflight.py check --event workflow_dispatch
--ref-type branch --ref-name checkout --sha HEAD` reads version 0.16.0
in every file. `changelog.py check` finds no fragment left, and
`measured_numbers.py` and `api-doc-ids.py` pass.
- **Witness and fixtures** come from this pull request's CI run
42555924918, on 4dac3e6.
- The changes are `witness_version`, the two verdict hashes and the
fixtures' version strings.
- Both rvt-rs observations also gain RE-354's one diagnostic note ("1
type text parameter(s) ... left out"), which the committed observations
had missed since #1185.
- Both verdicts replay PASS locally with CI's arguments, byte-identical
to the committed ones.
- **Release review** (rvtReview's second read) blocked on two
overclaims, and both are fixed:
- `IsExternal` on 2026 and 2027 walls, curtain walls, members and
plates;
  - the same-project check's reach.
It found two dropped caveats, also fixed: the beam rule's reach (#1514)
and #1489's two doors. Its two minor points were fixed too: the
non-finite refusal's scope and the wall-hosted origin.
- Checking the run myself added three corrections: the held-out pipe,
wall and beam counts on 2015 to 2023 (the notes had said none was
scored), Vitoria's 44 `InvertElevation` values counted apart, and the
pipe entry's matching claim.

## Audit-honesty checklist

- [x] The introduction keeps each entry's caveats and adds a "Not
measured" paragraph: the 2015 to 2023, 2026 and 2027 readers held to the
same project's other save, and 2015 to 2023 scored on held-out projects
only, as counts; the 2025 to 2027 and Snowdon Towers Areas checked
against no Revit export; the one-project Furniture Systems and wall end
order; the office-only thresholds; the door origin; the release workflow
checks first run by this tag.
- [x] No emojis, private paths or internal jargon.

## Legal and contribution hygiene

- [x] Apache-2.0; no Autodesk proprietary source, decompiled internals
or NDA'd SDK content.

## Breaking changes

Behaviour changes are listed under "Upgrading from 0.15": the
diagnostics' `building_elements` and `by_ifc_type` count only written
elements, door and window placements and their rotations move, Furniture
Systems change class, a space has no material association by default,
the room schedule gains a column, and a non-finite export is refused.
The stable API's changes are additions; `semver checks` in this pull
request's CI reports on them.

## Related issues

Refs #1190, #869, #1165, #1185, #1203, #1261, #1194, #1332, #1334,
#1335, #1357, #1359, #1368, #1385, #1396, #1408, #1410, #1411, #1417,
#1422, #1424, #1429, #1430, #1437, #1440, #1444, #1445, #1447, #1457,
#1465, #1466, #1473, #1475, #1492, #1494, #1496, #1498, #1559, #35,
#155, #156, #1158, #1192.
DrunkOnJava added a commit that referenced this pull request Nov 9, 2026
… own record on Revit 2015 to 2027, and ports their SystemType (#1190) (RE-371) (#1524)

## Summary

A duct's own native record (`RbsDuctCurve`) gives it its type, its
section, the line it runs along at any slope, its taps, its reference
level and elevations, and each connector's join, direction and system,
on every release from 2015 to 2027. Every duct is now typed and drawn as
its section along that line, with Revit's `Constraints` values; every
port gets the `SystemType` its connector's system names, and Exhaust Air
ports are `SOURCEANDSINK`; on 2015 to 2022 the family instances' ports
and joins are read. On Snowdon Towers HVAC (2025) the record gives
Revit's own type name, `Length`, section, body and `Constraints` values
on 1,053 of 1,053 ducts. It's an eleventh slice of #1190, stacked on
#1523 (pipes, RE-370), whose `attach_native_pipes` it mirrors.

## Motivation

- On 2015 to 2023, 2026 and 2027 a duct is an untyped `Duct-<ElementId>`
box with no `Length` and two unplaced ports: 724 ducts on `rme_basic`,
728 on `rme_advanced`.
- On 2024 and 2025 RE-134's byte scan typed none of Snowdon Towers
HVAC's 1,053 ducts, and a duct off the model's axes (356 there) has no
`Length` or ends.
- A duct tapped into another has no port or join at the tap (406 on
Snowdon).
- No port has a `SystemType` (#834); Revit's IFC4 export writes one on
every port.
- Every Exhaust Air port has a direction where Revit's export writes
`SOURCEANDSINK` (1,004 on Snowdon).
- On 2015 to 2022 no family instance's port or join is read: 2,430 ports
and no connection on 2019's `rme_basic`, against 7,370 and 2,948 on its
2024 save.

## Changes

- `src/research/partition_schema_mvp/mep.rs`: `attach_native_ducts`. One
projected native pass over the ducts not yet drawn along their line and
the file's `AbsDuctType` records. From each duct's record: its type
(`m_idType`, named by `SymbolInfo.m_name`, shaped by its sweep profile),
its section (`m_dWidthOrDiameter`, `m_dHeight`, the height along
`m_vNormal`), its one `GLine`, its taps
(`SegmentConnectorPosition.m_paramOnCurve` between 0 and 1), each
connector's join (`m_arrRefs`, type 1), and, where it's justified at its
centre, its reference level (`m_assocLevelId`, before 2024
`m_idLevelStart`) and the elevations of its ends above it
(`m_dOffsetStart`, `m_dOffsetEnd`). It writes the fields RE-134 writes,
so the system family, `Pset_DuctSegmentTypeCommon`, quantities and end
ports come from the existing code, plus the normal, the taps, the joins
and the offsets. The line must pass a box test like RE-131's (the swept
section is the record box within 0.002 ft); an oval duct keeps its box.
It runs in the 2015 to 2023 branch and, on 2024 to 2027, before RE-134's
scan; RE-134, the duct end keys and RE-172's level leave a duct the
record gave values alone. `native_pipe`'s line and end reading is
shared, and a pipe's record now gives its joins too. The 2015 to 2023
branch calls `attach_connector_pairs`.
- `src/research/native_connectors.rs`: the connector pass reads each
calculation's `m_eSystemType` (`Calculation`,
`InstancePort::system_type`), names it (`distribution_system_of`: 1 and
2 `VENTILATION`, 3 `EXHAUST`, 7 `HEATING`, the classifications measured
against Revit's IFC4 export; revit-ifc's `ConnectorExporter` read for
the names, nothing copied), and gives an Exhaust Air connector
`SOURCEANDSINK` (`port_flow_direction`). It and `family_instance_joins`
read 2015 to 2027 and ids in their 4-byte form as well.
`native_duct_shapes` reads 2015 to 2027.
- `src/ifc/export_content.rs`: a duct drawn along its line is its
section extruded along it (`BodySource` `native_duct_line`); each tap's
port is on the line at its parameter; `Constraints` gets the Start, End
and Middle Elevation, the Lower and Upper End Centerline, Bottom and Top
Elevation, `Slope` (an `IfcRatioMeasure`) and the justification.
- `src/ifc/mod.rs`, `src/ifc/step_writer.rs`, `src/ifc/entities.rs`: a
port's `SystemType` is written; a port joined to a placed one takes its
point with the axis turned unless exactly one of the two is a sink; a
tap places no other port; a port with no direction or system read takes
the opposite direction and the system of the port joined to it.
`PropertyValue::Ratio`.
- rvtReview's join rule, `src/ifc/export_content.rs`, `src/ifc/mod.rs`,
`src/ifc/from_decoded.rs`, `docs/export-diagnostics.md` and its schema:
a join of two connectors is written only where each end keeps the other
as its one partner, or as the one partner both sides' lists name; the
joins left out are counted in `exported.port_joins_left_out` under
`connector_named_with_conflicting_partners`.
`src/research/partition_schema_mvp/levels.rs`: a reference level a
duct's own record named is not pushed a second time.
- `probes/examples/probe_re371_ducts.rs` (each duct as the export draws
it; with `--native`, each duct's record and every connector's
calculation), `tools/re/ducts_vs_ifc.py`,
`reports/element-framing/RE-371-native-ducts.md`, an addendum to
`docs/format-reconnaissance.md`, `docs/status.md`, `docs/evidence.md`,
`docs/supported-profile.md`,
`changelog.d/added/1190-ducts-slopes-port-systems.md`.

## Testing

Unit tests are banned in this repository: do not add them. Show the
change working end to end on real files instead.

- [x] `tools/check-local.sh` passes (fmt, clippy, rustdoc, build,
real-file / CLI / contract checks)
- `tools/check-local.sh --corpus` on the local corpus passes: all 301
real-file tests on the default and full-corpus runs, and the API doc-id
check. A first run failed one test,
`value_sources_offsets::project_corpus_value_sources_name_the_copy_the_reader_took`,
because the new `BodySource` `native_duct_line` named no reader; the
duct's own record and its type's are now noted as its value sources
(`native_duct`, `native_duct_type`, listed in
`docs/export-diagnostics.md`), and the export doesn't change with it.
`cargo +1.87 check --all-targets` (MSRV) is clean.
- [x] Verified end to end on real Revit files: the command, the files
(and their licence), and the measured result against Revit's own export
are in the PR body, with the script or probe that reproduces it
- **Ducts against Revit's own export**, `probe_re371_ducts --native` and
`tools/re/ducts_vs_ifc.py`: Snowdon Towers HVAC (2025, Revit 2025's
IFC4X3 export, local only) **1,053 of 1,053 ducts** with Revit's type
name, `Length`, section and body (the swept section's world box against
Revit's within 0.01 ft; 1,045 round, 8 rectangular, level, vertical and
sloped), and every `Constraints` value Revit writes (`Slope` on 1,012 of
1,012, none on the 41 vertical ducts, as Revit); RE1 Mechanical (MIT,
`magnetar-io/revit-test-datasets`, IFC2X3) 25 of 25 with Revit's type
name, `Length` and body.
- **Ports against Revit's own export**, `tools/re/ports_vs_ifc.py` on
the export: Snowdon Towers HVAC 5,155 ports (4,749 before; Revit 5,217,
the other 62 on its 31 flex ducts, not read), 2,528 of Revit's 2,590
connections (2,122 before) and none it leaves out, every port at Revit's
point (17 unplaced before), 5,008 with its axis (4,100), `SystemType`
Revit's on 5,118 (0; the other 37 electrical), `FlowDirection` on 4,889
(3,496), all 1,004 Exhaust Air ports among them. RE1 Mechanical and
Plumbing keep 59 of 59 and 118 of 118 connections and every flow, and
every port of both now has Revit's point and axis (16 fitting ports were
reversed). The BIM4LCA office's 24 pipe ports are `HEATING`, as Revit's
(local only).
- **Not against a Revit export on 2015 to 2023, 2026 or 2027**: none I
have holds a duct. Held to the same Autodesk MEP samples saved by 2024
(pinned, fetched, never stored), which can't catch an error that save
shares. Every duct of the twelve MEP saves is typed and drawn, and its
type, length, section, ends, level and offsets are the 2024 save's but
for nine 2015 ducts the project replaced or redrew between the saves. On
2025 to 2027 every port and connection is the 2024 save's (2026 and 2027
leave unjoined family ports unplaced, as before). On 2019, 7,184 of
7,370 ports and 2,764 of 2,948 connections (all of them the 2024
save's), no port's system another than the 2024 save's; the rest are
family instances whose 2019 record the native path doesn't decode
(report §5).
- **Joins left out** (rvtReview). On 2015 and 2019 the records of five
duct taps in each of `rme_basic` and `rme_advanced` name one duct
connector as the partner of two others: three joins in a chain, of which
the 2024 save has two and not the third. The first form of this change
wrote all three (2,774 connections on `rme_basic` 2019, 2,769 of them
the 2024 save's). A join is now written only where each of its ends
keeps the other, so 10 joins on each of those four saves are left out,
five the 2024 save has and five it does not, and each is counted. Of the
93 models of Measure run
[42585494298](https://github.com/DrunkOnJava/rvt-rs/actions/runs/42585494298)
those four are the only ones with a join left out. On `rme_basic` 2019
the connections are 2,764 and all the 2024 save's, and the cost is 10
ports: 5 lose the place their join gave them and 5 their direction (flow
different 38 to 43). The ports table and the per-file table of RE-371
are restated, with the comparison that reproduces the old rows to the
digit (section 5).
- **Byte identity** against the RE-370 branch,
`SOURCE_DATE_EPOCH=1700000000`: 25 of 58 sample saves (Autodesk's 53 of
2015 to 2027, Snowdon Towers' five of 2024) and 173 of 206 local project
files of 2008 to 2027 export IFC and diagnostics byte for byte as
before, Core Interior among them. On each of the 33 + 33 that change, an
element-by-element comparison (class, name, every property set and
representation by GlobalId; every port's name, flow, type, system and
place; the connections) finds nothing changed but ducts, ports and
connections. The files that change are the MEP files, the 2025 Snowdon,
Golden Nugget and サンプル files, RE1 Mechanical and Plumbing (port axes),
the office (24 ports' `SystemType`), and architectural files of 2015 to
2023 whose MEP family instances (lighting, sanitary, electrical
fixtures, 30 to 36 a file) now have ports. Report §6 has the table. The
join rule changes the four saves above further, and no other model of
that run.
- [x] If this touches the IFC exporter: the witness verdicts replay (see
CONTRIBUTING.md) or the changed observations are refreshed in this PR
- Core Interior (2024) has no ducts and exports byte for byte as before,
so its observations are unchanged.
- [ ] If this is a performance change: reran `tools/bench.sh` and
attached the before / after
- N/A. No slower where the work is the same: 5.1 to 5.2 s before and 5.1
to 5.3 s now on Snowdon Towers HVAC, 15.2 s and 15.6 s on `rme_basic`
2027, 30.2 s and 28.1 s on Golden Nugget's building services, 3.9 s on
both for `rac_advanced` 2023. A 2015 to 2022 MEP file now reads its
family instances' ports and joins, as 2024 does: `rme_basic` 2019 takes
6.7 s against 4.4 s (its 2024 save takes 17.4 s).

```
tools/fetch-autodesk-samples.sh samples 2015 2027
cargo run --profile ci -p rvt-probes --example probe_re371_ducts -- samples/2019-rme_basic_sample_project.rvt > 2019.txt
cargo run --profile ci -p rvt-probes --example probe_re371_ducts -- samples/2024-rmebasicsampleproject.rvt > 2024.txt
diff 2019.txt 2024.txt
cargo run --profile ci -p rvt-probes --example probe_re371_ducts -- --native _project_corpus/Revit/RE1-Mechanical.rvt > native.txt
python3 tools/re/ducts_vs_ifc.py native.txt _project_corpus/Revit/RE1-Mechanical.ifc
cargo run --profile ci --bin rvt-ifc -- _project_corpus/Revit/RE1-Mechanical.rvt -o re1.ifc
python3 tools/re/ports_vs_ifc.py re1.ifc _project_corpus/Revit/RE1-Mechanical.ifc
```

## Audit-honesty checklist

- [x] README / docs reflect the current state after this PR — no claims
of features that are not actually shipped in this PR
- [x] A user-visible change has its entry as a fragment under
`changelog.d/<section>/` (see `changelog.d/README.md`), not in
`CHANGELOG.md`
- [x] If a limitation was resolved, the "Known limitations" / "What
works today" section in the relevant docs is updated
- `docs/status.md`, `docs/evidence.md` (the 2024 and 2025, 2026 and 2023
rows), `docs/supported-profile.md`.
- [x] If a new limitation was introduced, it is documented in the PR
body and in-code
- None new. Not read, report §7: flex ducts and pipes (a
`GHermiteSpline`), oval ducts' sweep, a pipe's `Constraints` elevations
and a level pipe's invert outside 2025 (no oracle), a port's
`SystemType` other than the four measured and any electrical port's, the
flow directions revit-ifc's export order decides (266 on Snowdon), and
the 2015 to 2022 family instances the native path doesn't decode.
- [x] Commit messages describe WHAT changed and WHY, not "fix things" or
"updates"
- [x] No emojis in code, docs, or commit messages
- [x] No private paths, personal email addresses, or internal jargon in
committed files
- [x] If this is a reverse-engineering finding: a reproducible probe
under `probes/examples/` and a dated addendum to
`docs/format-reconnaissance.md` are included
  - `probes/examples/probe_re371_ducts.rs`, `tools/re/ducts_vs_ifc.py`.

## Legal and contribution hygiene

- [x] I agree this work is licensable under Apache-2.0 (see
`CONTRIBUTING.md`)
- [x] This PR contains no Autodesk proprietary source, decompiled
internals, or NDA'd SDK content (see `CLEANROOM.md`)
- revit-ifc's `ConnectorExporter` (CLEANROOM.md source 5) was read for
how Revit's export names a classification and orders a join's ports; no
code was copied or translated.
- [x] Any new test fixtures use synthetic values (`testuser`, `111111`,
`FY-20XX`, etc.) and contain no real-world PII
  - No fixtures.

## Breaking changes

Public API, research and IFC model types:

- `native_connectors::port_flow_direction` takes a fourth argument, the
connector's system classification.
- `native_connectors::ConnectorPorts::segments` maps to a `Calculation`
(direction and system) instead of a direction.
- `native_connectors::InstancePort` has a `system_type` field, and
`ifc::entities::IfcEntity::Port` a `system_type` field
(`#[serde(default)]`, so serialised models still read).
- `ifc::entities::PropertyValue` has a `Ratio` variant; an exhaustive
`match` outside the crate needs an arm for it.
- `ifc::IfcModel` and `ifc::ExportedModelDiagnostics` have a
`port_joins_left_out` field (a count by reason); a struct literal of
either outside the crate needs it.

New: `NATIVE_DUCT_REVIT_VERSIONS`, `DUCT_NORMAL_FIELDS`,
`DUCT_OFFSET_FIELDS`, `DUCT_TAPS_FIELD`, `DuctBody`,
`duct_body_from_fields`, `duct_offsets_from_fields`,
`duct_taps_from_fields`, `square_to`, `native_connectors::{Calculation,
EXHAUST_AIR, distribution_system_of}`, `DuctShape::of_profile` made
public.

## Screenshots or output samples

`rme_basic`, duct 420841, as the export writes it:

```
2019 before  IfcDuctSegment 'Duct-420841'                                    box body, no Length, ports Port_420841_0, _1 NOTDEFINED
2019 after   IfcDuctSegment 'Rectangular Duct:Mitered Elbows / Taps:420841'  native_duct_line, Length 4.202239 m,
             ports InPort_420841_0 SINK, OutPort_420841_1, _4, _5 SOURCE (two taps), all VENTILATION
             Constraints: Reference Level 'Level 2', Middle Elevation 3.0132 m, Slope 0.000009, ...
2024 save    the same
```

## Related issues

Refs #1190, #96, #834, #869

## Notes

Rebased on `main` after RE-370 and after #1518, #1519 and #1587 landed.
rvtReview's commits on this branch are the join rule (`baab0262`) and
the restated RE-371 (`215fd384`).

---------

Co-authored-by: puzzbobb <--?>
Co-authored-by: Griffin Long <[email protected]>
@puzzbobb
puzzbobb deleted the survey-1190-s10 branch November 15, 2026 15:10
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.

2 participants