Skip to content

feat(ifc): write Pset_PipeSegmentOccurrence.InvertElevation as a height above the model's zero, and on a Revit 2024 vertical pipe (W7) - #1169

Merged
DrunkOnJava merged 4 commits into
mainfrom
w7/pipe-invert-elevation
Oct 30, 2026
Merged

DrunkOnJava merged 4 commits into
mainfrom
w7/pipe-invert-elevation

Conversation

@DrunkOnJava

Copy link
Copy Markdown
Owner

Summary

Pset_PipeSegmentOccurrence.InvertElevation is a height above the model's zero, not above the pipe's storey, and a vertical pipe's needs no inner diameter. rvt-rs now writes it that way: all 12 of the BIM4LCA office's pipes are Revit's value as built and at building permit, where none was written; RE1's 69 are unchanged.

Motivation

W7: Revit's IFC4 export writes InvertElevation on the office's 12 pipes (Pipe Types:JSV-3, 55.32 m each) and rvt-rs wrote none (Measure run 41104131261).

Two things stopped it, both in the invert rule RE-157 measured on RE1:

  • The reference. RE-157 concluded the invert is above the pipe's storey, and pipe_inverts_above_storeys took the storey's elevation off. Every RE1 pipe is on Level 1 at elevation 0, so the two readings gave the same numbers. The office's 12 pipes are vertical, on Level_01 (55.5 m); each extrusion starts 179.19 mm below that storey's placement, so the lower end is at 55,320.81 mm, and that is the value Revit writes. Above the storey it would be -179.19 mm. The invert is the height in the model's frame.
  • The diameter. pipe_invert_height read the inner diameter before it asked whether the pipe is vertical, and a Revit 2024 pipe's diameter is not read (MEP ports and pipe cylinders outside Revit 2024 and 2025: no 2026 or 2027 MEP model has a Revit export to measure against #869), so a 2024 pipe got nothing. A vertical pipe's invert is its lower end, with no diameter. A horizontal pipe still needs it and a 2024 one still gets none: no measured model has one.

Changes

  • src/ifc/export_content.rs: pipe_invert_height returns the lower end of a vertical pipe before reading the inner diameter; pipe_inverts_above_storeys, which took the storey's elevation off, is gone and src/ifc/mod.rs loses its call. The public computed_inverts field it read stays, unread, so the stable API does not change.
  • reports/element-framing/RE-157-pipe-inner-diameter.md: section 6, a dated correction, and a pointer from section 4.
  • tests/invert_elevation.rs: its header says "above the model's zero", as Revit's value is.
  • docs/release-1.0-criteria.md: W7 lists pipes' InvertElevation.
  • changelog.d/changed/pipe-invert-model-height.md.

Testing

Measure run 41112675273, unfiltered (-f base=main -f nordic=true -f r2025=true, every scorer, head 13f12ce against main 514bca8); run 41109551247, on the head before the last commit (which only keeps a public field), gave the same rows. Only the office's two files change. Every other model's outputs, ifc.sha256 included, are identical to main's: RE1 Mechanical's 6 and Plumbing's 63 inverts, equal before, are the same bytes after, and Core Interior, RE1 Architecture and Electrical and the 23 R2025 models do not move.

psets_vs_ifc before after
office as built, Pset_PipeSegmentOccurrence.InvertElevation 12 values, equal 0, missing 12 12 values, equal 12, missing 0
office at permit 12 values, equal 0, missing 12 12 values, equal 12, missing 0
office as built, all properties equal 44,067, different 56, missing 13,650 equal 44,079, different 56, missing 13,638
office at permit, all properties equal 44,249, different 56, missing 13,610 equal 44,261, different 56, missing 13,598

diagnostics.decoded.parameter_value_count goes up by the 12 values on each file (44,344 to 44,356 as built, 44,530 to 44,542 at permit), as the Pset_ values of the file do. The IFC schema check (schema.txt) differs only in its set count.

  • Verified end to end on real Revit files: the BIM4LCA office (CC BY-SA 4.0), RE1 (MIT) and the R2025 models against Revit's own exports, by Measure run 41112675273
  • Revit's IFC4 export is the oracle; nothing is written that it omits, none differs

Limits

The reading "above the model's zero" rests on the office, the one model whose pipes stand above a storey at zero; RE1 cannot tell the two apart. A horizontal or sloped pipe on a storey above zero is not measured: no model has one.

Breaking changes

None. pipe_inverts_above_storeys was pub(super). TypedProductionAppend::computed_inverts is a public field that nothing reads any more; it stays until the unused stable API is removed in one breaking change before 1.0.

Related issues

Refs W7 (docs/release-1.0-criteria.md), #869.

@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 30, 2026 19:31
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Owner review: the change moves the invert from above the pipe's storey to above the model's zero, for every pipe, measured on the office's 12 vertical pipes (Level_01 at 55.5 m: 12 of 12 equal on both files) with RE1's 69 unchanged. The generalisation to horizontal pipes on an upper storey (unmeasured; the PR's Limits say so) is consistent with revit-ifc: ExporterInitializer_PsetDef.cs (IFC_v24.3.40) defines Pset_PipeSegmentOccurrence.InvertElevation from the parameter named "Invert Elevation" (the InvertElevationCalculator it looks up by reflection does not exist in the tree), so vertical and horizontal pipes read one parameter with one reference. The vertical branch no longer needs the 2024 inner diameter (#869). computed_inverts stays as an unread public field until the breaking unused-API removal; noted. Unfiltered Measure 41112675273: only the office moves; parameter_value_count +12 each. Armed.

@DrunkOnJava
DrunkOnJava merged commit b9e0ce7 into main Oct 30, 2026
28 checks passed
@DrunkOnJava
DrunkOnJava deleted the w7/pipe-invert-elevation branch October 30, 2026 19:38
DrunkOnJava added a commit that referenced this pull request Oct 30, 2026
…mns' Slope, the building's Reference, door openings' values (W7) (RE-277) (#1176)

## Summary

Adds the probe behind the W7 office findings (RE-275, RE-276) and
RE-277, which records three office properties that the `.rvt` does not
decide, so none is written: columns' `Slope`, the building's
`Reference`, and the door openings' `Reference` and `FireExit`. No
export changes.

## Motivation

W7 listed these gaps on the BIM4LCA office (Measure run 41104131261).
The positive ones got their own PRs (pipes' `InvertElevation` #1169,
beams' `Span` #1163, `Slope` #1173 and `Roll` #1174, storeys'
`Reference` #1171 and `EntranceLevel` #1172). The rest were looked for
in the same pass and have no source in the file, which binds future
work, so the evidence is written down:

- **Columns' `Slope`** (73 of 279 columns as built, 101 of 345 at
permit, 0.0 on all): revit-ifc's `SlopeCalculator` reaches a vertical
column only through its last step, the largest top-facing face of the
last object of the element's geometry, so the property exists where
Revit's API returns a solid there. The probe lists each column's native
record. Six columns have a record identical in both files and Revit
gives them the property at permit only; twelve identical columns on one
level split 5 to 7 by whether a join is user-set; no cell of the
attachment-by-join table has the property on every column.
- **The building's `Reference`** (`Project Information`): not stored in
the file as UTF-16 or UTF-8 text but for two RTF help-text lines, so
writing it would guess the exporting session's name for the element.
- **Door openings' `Reference` and `FireExit`** (140 and 31 as built):
on the openings Revit writes where a door cuts a further wall, which
rvt-rs does not write; the door's own filled opening has no set in
Revit's export, as in rvt-rs's (the scorer now says so, #1161).

## Changes

- `probes/examples/probe_w7_office_gaps.rs`: for a model's parameter
definitions, every Level (its native record, saved parameters and the
record of its type), and every structural column, structural framing
element and pipe (decoded fields, saved parameters and native objects'
scalar fields), one JSON line each.
-
`reports/element-framing/RE-277-office-properties-the-file-does-not-decide.md`,
`changelog.d/research/office-properties-not-in-the-file.md`.

## Testing

Unit tests are not added. The probe ran on GitHub's runners on both
office files and the 24 R2025 models: Measure runs 41111710319 (office
as built, an earlier version of the probe), 41113408569 (office and
R2025, this probe). The report's counts are from those outputs joined
with Revit's exports by `Tag`; the commands that reproduce them are in
the report.

- [x] Verified end to end on real Revit files: the BIM4LCA office (CC
BY-SA 4.0) and puzzbobb's R2025 models (Apache-2.0), against Revit's own
exports, by the Measure runs above
- [x] Reverse-engineering finding: a reproducible probe is included, and
the report states its status (negative)

## Breaking changes

None.

## Related issues

Refs W7 (`docs/release-1.0-criteria.md`), #1161, #1169, #1163, #1171,
#1172, #1173, #1174.
Repository owner deleted a comment from chatgpt-codex-connector Bot Oct 31, 2026
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