Skip to content

feat(ifc): Level, Base/Top Constraint and Reference Level properties from the element association record (RE-172) - #751

Merged
DrunkOnJava merged 12 commits into
DrunkOnJava:mainfrom
helenkwok:feat/level-parameters
Oct 18, 2026
Merged

DrunkOnJava merged 12 commits into
DrunkOnJava:mainfrom
helenkwok:feat/level-parameters

Conversation

@helenkwok

@helenkwok helenkwok commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Writes Revit's level parameters in a Constraints property set, read from the per-element association record (d3 02 01 00 00 00 | ElementId | 0 | LevelId | 0 | ff x6, LevelId at ElementId + 8). Closes #750.

Names follow Revit's export per class: walls and curtain walls Base Constraint and Top Constraint (Up to level: <name>), columns Base Level and Level, railings, roofs and stairs Base Level, duct and pipe segments Reference Level, everything else Level. Values are IfcLabel, as in Revit's export.

Fail closed: a value is written only when the id is a Level recovered by partition_level_records, and only for Revit 2024. Where the association record holds 0xffffffff (beams, stairs, braces, some MEP terminals, lights and proxies), RE-174 below reads the level from elsewhere. Top Constraint is written only where its group is located inside the record and holds a recovered Level id, so coverage is partial.

Additive: storey containment, LevelElementId and the level binding of RE-27, RE-59, RE-60 and RE-68 are untouched. Element counts and storey containment are identical to main (120e2f9) on all seven files measured.

Measured against Revit's IFC4 export, by Tag (equal / elements where Revit has the property):

file Level Base Level Base Constraint Top Constraint Reference Level
racadvanced 5214 / 5214 190 / 190 180 / 180 177 / 177
Technicalschool 5214 / 5214 190 / 190 180 / 180 177 / 177
rmeadvanced 4151 / 4151 141 / 141 166 / 166 165 / 165 1216 / 1216
rmebasic 4196 / 4196 141 / 141 166 / 166 165 / 165 1215 / 1215
racbasic 359 / 359 4 / 4 56 / 56 48 / 48
rstadvanced 502 / 502 203 / 203 6 / 6 6 / 6
rstbasic 67 / 67 30 / 30 9 / 9 9 / 9

Where rvt-rs writes a property Revit does not (racadvanced 1 Base Level, Technicalschool 6), it is counted outside the table.

Not covered: stairs that rvt-rs does not decode as class Stair, Top Constraint on walls whose second group is not located, Revit 2023 and 2025, and DACH and Snowdon (no elements exported on main).

Verification: tests/level_parameters.rs compares every written value with Revit's export (set RVT_REVIT2024_SAMPLES_DIR to a folder holding racadvancedsampleproject.rvt and its Revit IFC; it skips otherwise). The public corpus convention (RVT_PROJECT_CORPUS_DIR) has no Revit 2024 sample, hence the separate variable. cargo fmt --check, cargo clippy --all-targets --all-features -- -D warnings and cargo doc with -D warnings pass. ifc_synthetic_project::synthetic_project_emits_valid_ifc4 fails on main too (expects 2 property sets, finds 12) and is not touched.

Second test, on a CC BY-SA 4.0 file (tests/level_parameters.rs, RVT_NORDIC_LCA_DIR): BIM4LCA / Nordic LCA ARK_NordicLCA_Housing_Terrain-Concrete_BuildingPermit.rvt (Revit 2024, 17.6 MB; VTT, Granlund, Gravicon, Insinööritoimisto Kallinen; https://cris.vtt.fi/en/publications/bim-files-to-download/). Not committed: fetched by URL and sha256 as in corpus/tier2/README.md. Its Revit IFC has no Revit level parameters, so the oracle is Revit's storey containment (parts take their host's storey). rvt-rs exports 507 elements on 4 storeys and writes a level for 467 of them; 467 of 467 are Revit's storey, and every value is a recovered Level name. Housing_Concrete_BuildingPermit (99.8 MB): 1388 of 1401 agree (99.1%) once elements that Revit contains in a room (IfcSpace: furniture, sanitary terminals, generic models) take the room's storey; the 13 others are openings, which Revit puts on their host's storey. The test's storey oracle follows room containment for this reason. Office_Concrete_BuildingPermit: 12,232 of 12,783 (96%), measured with a standalone scanner against direct storey containment only. Housing_Timber_* recovers no Level ids on main, so it writes none.

Attribution: BIM4LCA example buildings, CC BY-SA 4.0. The files are not redistributed in this repository.

Report: reports/element-framing/RE-172-level-parameters.md.

Clean-room: this finding comes from public Autodesk Revit 2024 sample files with Revit's own IFC4 export as the oracle and exported symbol names only; no SDK source and no decompiled or disassembled code was used.

Added: stairs, beams and other elements with no association level (RE-174)

  • Stairs: Base Level and Top Level are read from the association record. Base Level is a u32 at ElementId + 115, 121, 129 or 137, depending on the record variant, and Top Level is exactly 32 bytes later. They are written only when exactly one of the four positions gives two different recovered Levels. Otherwise see RE-176 below.
  • Beams, braces, MEP terminals, lights and proxies whose association level is 0xffffffff: the level is read from the element record's counted id lists, through the existing decode_reference_list. It is the 2nd list if that list names a recovered Level, otherwise the 1st. A value is written only when exactly one recovered Level is named; for beams and members with two candidates, see RE-175 below. Beams and listed members get Reference Level; other classes get Level.

Measured on a clean build, against Revit's IFC4 export by Tag. Values are equal to Revit / elements where Revit has the property; storeys and all earlier properties are unchanged.

file Reference Level stair Base + Top Level other Level
racadvanced 35 / 35 5 / 5 proxies 40 / 40
rstadvanced 395 / 395 – –
rstbasic 339 / 339 1 / 1 –
racbasic – 3 / 3 proxy, lights, sanitary: all equal
rmeadvanced – 0 of 4 written proxies 512, lights 307, air terminals 28, sanitary 11: all equal
Technicalschool 35 / 35 – proxies 40 / 40

There are no wrong values. On racbasic, 2 railings and 1 roof get a Base Level where Revit writes none. tests/level_parameters.rs also checks Reference Level (at least 30) and Top Level (at least 4) on racadvanced. Report: reports/element-framing/RE-174-stair-and-listed-levels.md. The same clean-room provenance applies.

Added: beams whose record lists two Levels (RE-175)

When the id list names more than one recovered Level, a beam's (IfcBeam) or member's (IfcMember) Reference Level is the one with the highest elevation. It is written only when every listed Level has an elevation and the highest is unique; otherwise nothing is written. Other classes are unchanged: applied to them, the rule wrote the upper Level as Base Level on 21 stairs where Revit has the lower one.

Measured against Revit's IFC4 export by Tag (written / equal to Revit / elements where Revit has the property):

file before after
racadvanced 35 / 35 / 38 37 / 37 / 38
Technicalschool 35 / 35 / 38 37 / 37 / 38
rstadvanced 395 / 395 / 399 397 / 397 / 399
rstbasic 339 / 339 / 370 370 / 370 / 370

Taking the lowest Level instead is wrong on all 35 tiebreak beams. There are no wrong values in any Constraints property across the 8 Autodesk samples and 12 BIM4LCA files; rmeadvanced, rmebasic and racbasic are unchanged. The ones still without Reference Level are 3 roofs (racadvanced, Technicalschool, racbasic) and 2 truss assemblies (rstadvanced). On BIM4LCA Office_Timber As-Built and BuildingPermit, written levels go from 36 to 83, and 83 of 83 are Revit's storey. DACH and Snowdon are not measured (no elements exported on main).

tests/level_parameters.rs: the racadvanced Reference Level minimum is now 37, and level_parameters_survey_are_revits checks every model in RVT_REVIT2024_SAMPLES_DIR that has its Revit IFC beside it (zero wrong values, per-file minimums). Report: reports/element-framing/RE-175-beam-reference-level-tiebreak.md. The same clean-room provenance applies.

Added: stairs whose association record gives no Base/Top pair (RE-176)

A stair's element record lists its Base Level, its Top Level and, for some stairs, the Level above the top. For class Stair listing two or more recovered Levels, Base Level is the lowest listed Level and Top Level the next one above it, by recovered elevation. Written only when every listed Level has an elevation and the lowest three are at distinct elevations.

Per stair, against Revit's Constraints (Snowdon measured with #737 applied locally, not part of this PR):

rule right wrong skipped
Base = lowest listed 56 0 1
Top = second-lowest listed 54 0 3
Top = highest listed 41 13 3
control: Base = highest listed 0 54 3

On the 89 stairs where the association record already gives Base and Top, lowest = its Base and second-lowest = its Top on all 89. BIM4LCA (no Constraints set; reference = Revit's storey): lowest listed = storey for 72 of 72 stairs.

Survey (written / equal to Revit / Revit has it): Technicalschool Base Level 196 / 190 / 195 -> 201 / 195 / 195 and Top Level 0 -> 5 / 5; rmeadvanced and rmebasic Base Level 141 / 141 / 149 -> 149 / 149 / 149 and Top Level 0 -> 8 / 8. No wrong values in any property on any file; nothing else changes. level_parameters_survey_are_revits now requires the stair Top Level counts on the five stair-bearing Autodesk samples. Not covered: IfcStairs that rvt-rs does not decode as class Stair (BIM4LCA Housing_Concrete 31 of 38, Office 2 of 16). Report: reports/element-framing/RE-176-stair-levels-from-listed-levels.md. The same clean-room provenance applies.

Revit contains furniture and fixtures in their IfcSpace, which is aggregated
into the storey. On BIM4LCA Housing_Concrete_BuildingPermit that lifts
agreement from 1066/1257 to 1388/1401; the 13 others are openings, which
Revit puts on their host's storey.
…record lists (RE-175)

Where the element record's id list names more than one recovered Level,
the others are below the Reference Level: write the highest, for IfcBeam
and IfcMember only, when every one has an elevation and the highest is
unique. racadvanced 35->37, rstadvanced 395->397, rstbasic 339->370
Reference Level, all equal to Revit's export; the lowest-Level control is
wrong on all 35. Adds a survey test over every model with its export.
… record lists (RE-176)

Where a stair's association record gives no Base and Top Level, its
element record's id list names them, and for some stairs the Level above
the top: write the lowest as Base Level and the next above it as Top
Level, only when every listed Level has a recovered elevation and the
lowest three are distinct. Technicalschool 190->195, rmeadvanced and
rmebasic 141->149 Base Level and 0->5/8/8 Top Level, all equal to
Revit's export. Per stair: lowest = Base 56/56, second-lowest = Top
54/54, highest = Top wrong on 13; controls highest-as-Base 0/54. The
survey test now requires the stair Top Level counts.
# Conflicts:
#	src/partition_schema_mvp.rs
#	tests/integration/main.rs
#	tools/ci/test-targets.txt
The merge with main left this PR's Housing_Terrain-Concrete row after a
blank line, outside the table. It joins the row that lists the other
BIM4LCA files.
The merge kept the two closing lines both sides end with once, after
main's column-node functions, so highest_level lost its own. rustfmt
parses the file again, and its top-level items are exactly the union of
this PR's and main's.
Both committed rvt-rs observations and both Core Interior manifests move
by the Constraints sets: IFCPROPERTYSET and IFCRELDEFINESBYPROPERTIES
2948 -> 3802, IFCPROPERTYSINGLEVALUE 18520 -> 19856. Nothing else in the
observations moves, and both bridge witnesses still replay. Taken from
this PR's octetproof-core-interior artifact (run 39114958184).
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 18, 2026 09:29
@DrunkOnJava

Copy link
Copy Markdown
Owner

Thank you, this is a substantial piece of work. "No wrong values" against Revit's export across seven samples and the BIM4LCA files, with fail-closed rules for every case the association record doesn't cover, is exactly the evidence standard here.

To land it on today's main I pushed four commits to your branch:

It merges when CI is green. #755 follows: it moves the same counts again, so it needs its own refresh once this is on main.

@DrunkOnJava
DrunkOnJava merged commit 3f63306 into DrunkOnJava:main Oct 18, 2026
25 checks passed
DrunkOnJava pushed a commit that referenced this pull request Oct 18, 2026
…Identity Data and Phasing sets (#755)

Writes the element's `Category`, family/type and `Phase Created` in the property sets Revit's IFC4 export uses. Closes #754.

- **Occurrence:** `Other` (`Category`, `Family`, `Family and Type`, `Type`, `Type Id`) and `Phasing` (`Phase Created`), as `IfcLabel`.
- **Type object:** `Other` (`Category`, `Family Name`) and `Identity Data` (`Type Name`), as `IfcText`, through `HasPropertySets`. Revit puts these on the type, not the occurrence.
- **Category:** `m_builtinCategory` (element record `+0x12`) through a table of 57 BuiltInCategory ids with the English names Revit's export writes (`builtin_category_name` in `partition_element_records.rs`). No table entry, no value.
- **Phase Created:** new `src/partition_phases.rs` reads phase names from their frame (`01 00 00 00 | u64 id | 56 x ff | 00 00 00 | u32 n | UTF-16 x n`), accepted only when the `ProjectPhase` class tag sits 38 bytes before the id or the frame is the element's own data and the id has an `OST_Phases` record. `attach_phases_created` takes the one phase id in the element record's reference list (RE-168); none or two phases writes nothing.
- Family/type values come from the existing decode (RE-38) and are unchanged; only their names are added.

Measured against Revit's IFC4 export by `Tag` (equal / elements where Revit has the property; no wrong values in any column):

| file | Category | Phase Created | Family | Type | Type Id |
|---|---:|---:|---:|---:|---:|
| Technicalschool | 5403 / 5403 | 5401 / 5401 | 5354 / 5393 | 5354 / 5393 | 5354 / 5393 |
| racadvanced | 5408 / 5408 | 5406 / 5406 | 5359 / 5398 | 5359 / 5398 | 5359 / 5398 |
| racbasic | 424 / 427 | 424 / 424 | 411 / 424 | 413 / 424 | 413 / 424 |
| rmeadvanced | 6483 / 6492 | 6477 / 6483 | 5223 / 6483 | 5223 / 6483 | 5223 / 6483 |
| rmebasic | 6527 / 6536 | 6521 / 6527 | 5268 / 6527 | 5268 / 6527 | 5268 / 6527 |
| rstadvanced | 904 / 904 | 904 / 904 | 904 / 904 | 904 / 904 | 904 / 904 |
| rstbasic | 454 / 454 | 454 / 454 | 450 / 454 | 450 / 454 | 450 / 454 |

`Family Name` and `Type Name` on the type objects: 22,948 of 25,471, none wrong. The family/type gap is mostly ducts and pipes (about 1,250 per rme file), which have no family/type on main either.

Not covered: Revit 2023 and 2025, `Phase Demolished`, non-English category names. DACH and Snowdon Architectural export no elements on main (#736). With #737 applied locally (not part of this PR): DACH `Category` 2381 / 2395 and `Phase Created` 2370 / 2379, Snowdon 5657 / 5708 and 5666 / 5685, none wrong; Snowdon family/type none wrong; **DACH family/type 14 wrong** (12 stair runs typed `陇`, 2 walls with another wall's type), from the existing RE-38 decode.

Test: `tests/category_type_phase.rs` (`RVT_REVIT2024_SAMPLES_DIR`, any `<name>.rvt` with its Revit `<name>.ifc`; skips otherwise). Every value written must equal Revit's, and `Category` and `Phase Created` must cover at least 99%. It fails on main (`Category 0 of 6609` on racadvanced and rmeadvanced) and passes here. `cargo fmt --check` and `cargo clippy --all-targets --all-features -- -D warnings` pass; the full suite passes except `ifc_synthetic_project::synthetic_project_emits_valid_ifc4`, which fails on main too.

Report: `reports/element-framing/RE-177-category-type-phase.md`.

Clean-room: public Autodesk Revit 2024 sample files with Revit's own IFC4 export as the oracle; `ProjectPhase` from the file's own schema stream. No SDK source and no decompiled or disassembled code was used.

## Landing notes

Merged with `main` by the maintainer, after #751. The unit-test module this PR added to `src/partition_phases.rs` is left out, because CONTRIBUTING doesn't accept new unit tests and CI doesn't run them; `tests/category_type_phase.rs` stays. The Core Interior witness observations and both project-count manifests count the sets this PR writes (`IFCPROPERTYSET` 3802 to 5908), taken from the PR's own CI artifact. The Revit 2024 sample comparisons in this description are the contributor's measurements; CI's corpora hold no Revit export of those samples.
DrunkOnJava added a commit that referenced this pull request Oct 18, 2026
[Unreleased] becomes [0.5.0] — 2026-10-18, with an introduction, the
contributors, and what to change when upgrading from 0.4. The community
pull requests' entries are added and credited (#737, #738, #744, #751,
#752, #753, #755, #757, #758), and the repeated Added, Changed, Fixed and
Research headings are folded into one each, keeping every entry (107) and
its order; everything from [0.4.0] down is unchanged.

CITATION.cff said 0.1.2 (2026-04-20), though RELEASE.md has it agree with
Cargo.toml at every tag. Its abstract now describes the project as the
README does, without the "first open-source tool" and "verified against
11 releases" claims.
DrunkOnJava added a commit that referenced this pull request Oct 18, 2026
## Summary

Prepare v0.5.0. Merging this is not the release: the release is the signed `v0.5.0` tag on the merged commit, which runs `publish.yml` (crates.io, PyPI, the release binaries and the container image). The tag waits for the maintainer's go-ahead.

## Motivation

`main` is 0.4.0 plus everything under `[Unreleased]`: Revit 2026 projects (experimental), MEP ports, connections and systems, Revit's level, category, family, type and phase properties, rooms aggregated into their storeys, Snowdon Towers exporting again, and the first pull requests from outside contributors. Before 1.0 a breaking change bumps the minor version, and these are breaking for a 0.4 user:

- The MSRV is 1.87 (was 1.85).
- `rvt` has no `wasm` feature; the bindings are the `rvt-wasm` crate (C6).
- Each `IfcSpace` is aggregated into its storey instead of contained in it (#744).
- `ElemTableHeader::record_count` is a `u32` (#764).
- Type objects take Revit's GlobalIds (RE-167).

## Changes

- **Versions 0.4.0 → 0.5.0:** `rvt`, `rvt-py` and its pin, `rvt-wasm`, the `stream_evidence` pin, both lockfiles (only the workspace crates' version lines change), `.release-please-manifest.json` and `viewer/package.json`.
- **`CHANGELOG.md`:** `[Unreleased]` becomes `[0.5.0] — 2026-10-18`.
  - An introduction, the contributors, and an **Upgrading from 0.4** section.
  - The community pull requests' entries are added and credited (#737, #738, #744, #751, #752, #753, #755, #757, #758).
  - The repeated Added, Changed, Fixed and Research headings, which later merges had appended, are folded into one each. All 107 entries are kept as written (checked as a multiset) and in their order, and everything from `[0.4.0]` down is byte-identical.
  - #778's clean-room policy change is added under Changed, so the section has 108 entries.
- **`CITATION.cff`:** it said 0.1.2 (2026-04-20), though `RELEASE.md` has it agree with `Cargo.toml` at every tag. Its abstract now describes the project as the README does, without the "first open-source tool" and "verified against 11 releases" claims.
- **Registry descriptions:** crates.io showed 0.4.0's description, which leaves out Revit 2023, and PyPI one that called element extraction and geometry "active research" and the export "document-level IFC4 scaffolding". `Cargo.toml` and `pyproject.toml` now say what the README says: typed elements from Revit 2023 to 2025 projects, 2026 experimental.
- **Witnesses:** the IFC header carries the version (#417), so both Core Interior `rvt-rs.json` observations and their verdicts are refreshed from this pull request's CI run.

## Testing

- CI on this pull request: every job `CI passed` requires, the witness replays among them.
- On the tag, the publish workflow runs its own checks before anything is published: wheel install and model open on each OS, `cargo install` and the CLI sample smoke, the docs.rs build preview and the viewer load smoke. crates.io and PyPI publish only after all of them pass, and PyPI only after crates.io.

## Audit-honesty checklist

- The docs keep describing 0.4.0 as the latest release until each 0.5.0 channel has been checked from what was published. That follows in a separate pull request (`docs/install.md`, `docs/python.md`, `docs/status.md`, `docs/supported-profile.md` and the README's release section).
- crates.io's trusted publisher (repository DrunkOnJava/rvt-rs, workflow `publish.yml`, environment `crates-io`) has to be in place before the tag, as `docs/maintaining.md` says; it is a registry-side setting this repository cannot check.

## Legal and contribution hygiene

N/A: release metadata only. Contributors are credited by their GitHub names in the CHANGELOG.

## Breaking changes

Listed under Motivation, with the migration for each in the CHANGELOG's **Upgrading from 0.4**.
DrunkOnJava added a commit that referenced this pull request Oct 18, 2026
…ed (#766) (#789)

## Summary

CI's tier-two job reads the BIM4LCA models its targets need, by byte range from VTT's `ARCH.zip`, so four targets that skipped in CI now run on every pull request (#766, second item).

## Motivation

Several of this month's fixes were measured on VTT's BIM4LCA example buildings (CC BY-SA 4.0). Their targets skip without `RVT_NORDIC_LCA_DIR`, which CI never set. A regression on those files would therefore pass CI, as #736 did on Snowdon. The targets are `level_parameters` (#751), `level_shared_elevation` (#752), `column_node_z` (#753) and `column_cut_body` (#757).

## Changes

- **`tools/ci/fetch-bim4lca.py`** (stdlib Python):
  - reads the archive's central directory from its last MiB;
  - for each pinned entry, reads the local header for the data offset, range-fetches the compressed bytes and inflates them as they arrive;
  - checks each file's size and sha256 against its pin.
  - A 200 answer to a range request, or an archive size other than the pinned 1,579,459,850 bytes, stops it as stale.
  - Exit codes: 0 when all files verify, 1 for a stale pin, 2 for an unreachable host after five tries.
  - `--pin` prints pin rows.
- **`research/bim4lca-models.tsv`:** the archive and five entries, 286 MB: four Revit 2024 models and Revit's IFC export of Housing_Terrain-Concrete.
- **`.github/workflows/ci.yml`**, tier-two job:
  - restores `_bim4lca` from a cache keyed on the pins file and fetches on a miss;
  - sets `RVT_NORDIC_LCA_DIR` only when all five verified;
  - reports a **NOT MEASURED** warning when the host is unreachable (the targets then skip visibly) and fails on a stale pin;
  - saves the cache from `main` only, so pull requests restore `main`'s copy rather than each storing 286 MB.
- **Docs:** `corpus/tier2/README.md`, a BIM4LCA section in `docs/reference-models.md`, and a Research entry in `CHANGELOG.md`.

## Testing

- **Pins:** the range reader's output for the five entries equals the hashes measured earlier on a full download of the archive, as recorded in `corpus/tier2/README.md`: `3df759b8…`, `c6b53726…`, `74712000…`, `23675d6c…` and the IFC's `c3946ee4…`.
- **This pull request's tier-two run** ([job 117734636435](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39147646493/job/117734636435)):
  - The cache missed, as it does before `main` has saved one. The fetcher read the five files by range in about 8 seconds, `[verified]` each, and set `RVT_NORDIC_LCA_DIR`.
  - The four targets ran and passed, with no "skipping" line:
    - `column_cut_body::nordic_office_concrete_columns_stop_at_the_slab` (11.0 s)
    - `column_node_z::nordic_housing_concrete_column_z_is_revits` (8.5 s)
    - `level_shared_elevation::nordic_housing_timber_keeps_its_storeys` (1.2 s)
    - `level_parameters::nordic_housing_terrain_levels_are_revits_storeys` (2.5 s)
- After merge, `main`'s run should save the cache and later runs restore it. Checked and noted here then.

## Out of scope

- Measure integration: the BIM4LCA reference exports are 80 MB each, and #763 needs it.
- #766's R2025 item, which waits on the licence.
- The Actions cache was cleared of 1,162 unusable entries (3.6 GB) before this, so the 286 MB fits.

## Breaking changes

None.
@puzzbobb puzzbobb mentioned this pull request Oct 18, 2026
14 tasks done
DrunkOnJava pushed a commit that referenced this pull request Oct 19, 2026
…tendToStructure its roof attachment (RE-185) (#798)

## Summary

Research for #35 (B28 walls, B42), as RE-185. A wall's `IsExternal` is its type's native `WallType.m_function`, and its `ExtendToStructure` is true exactly where its record holds a `JoinToRoofGStep`. A window's `FireRating` is a family-type text parameter that RE-77's id-first scan does not read. Probe and report only; no library change.

## Motivation

RE-158 found no wall type entry for `IsExternal`, and RE1's walls are all false, so nothing told the candidates apart. RE-154 left B42 waiting for a model with a longer fire rating. The maintainer asked on #35 for the patch attached there to be opened as a PR, renumbered from RE-172 (which is #751) to RE-185.

**Walls.** Both values come from native records:

- `IsExternal` is the type's `WallType.m_function` (0 Interior, 1 Exterior, the enum of the doors' `FUNCTION_PARAM`). The type comes from `SWall.m_WallAttributesId`.
- `ExtendToStructure` is true exactly where the wall's record holds a `JoinToRoofGStep`.

| models | walls | `IsExternal` T / F | equal | `ExtendToStructure` T / F | equal |
|---|---:|---|---:|---|---:|
| RE1 Architecture | 8 (1 curtain wall) | 0 / 8 | 8 | 0 / 7 | 7 |
| `R2025_Models.zip` (#356), 21 models | 117 | 117 / 0 | 117 | 32 / 85 | 117 |

None differs from Revit's IFC4 export.

**B42.** Of RE-154's four ids, RE-77 already names -1001206 Fire Rating (from the VIM export) and reads RE1's 7 walls from it. rvt-rs carries the value on each wall, but writes it only in its own identity set, not as `Pset_WallCommon.FireRating` or `Pset_ConcreteElementGeneral.FireRating`, the 14 values B42 counts.

**Family-type text.** A window's `FireRating` (`0.5h`, models 12 to 17) is a family parameter named `Fire Rating`. It is an entry in the family types' parameter table, `u32 n · UTF-16 · (u32 0 | ff ff ff ff · u16) · f64 · ElementId · i64 parameter · u32 · u16`, where the text belongs to the id after it. RE-77's id-first scan does not read it. This is measured on models 12 to 17 (report §3.3). Whether it accounts for some of the 166 rated Snowdon elements RE-77 leaves unread is **unmeasured**: Snowdon's export was not available.

## Changes

- `examples/probe_re185_wall_function.rs`: the probe that measures every value above against Revit's IFC4 export.
- `reports/element-framing/RE-185-wall-function.md`: the RE-185 report.

## 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)
- [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
- [x] If this touches the IFC exporter: N/A, no exporter change
- [x] If this is a performance change: N/A

```text
cargo run --profile ci --example probe_re185_wall_function -- RE1-Architecture.rvt R2025_models/*.rvt
```

Files: the RE1 Architecture model and the 21 wall-bearing models of `R2025_models.zip` (#356), each with Revit's own IFC4 export.

## 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] If a limitation was resolved: N/A, research only; nothing new is exported
- [x] If a new limitation was introduced: N/A
- [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 `examples/`, with the dated finding in `reports/element-framing/RE-185-wall-function.md`, as recent RE PRs do

## 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`)
- [x] Any new test fixtures use synthetic values (`testuser`, `111111`, `FY-20XX`, etc.) and contain no real-world PII: N/A, no fixtures added

**Contributor declaration (CLEANROOM.md).** The changes in this PR are based on byte observations of Revit files (CLEANROOM.md §Accepted sources 1), compared with Revit's own IFC4 exports of the same models: the RE1 Architecture model and the 21 wall-bearing models of `R2025_models.zip` (#356), with class and member names read from each file's own `Formats/Latest` schema. 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

None.

## Screenshots or output samples

N/A: no UI or IFC output change. The probe's measured tables are above and in the report.

## Related issues

Refs #35. Refs #356 (the `R2025_models.zip` models become CI evidence once that archive is pinned).

Not done: `LoadBearing` (no Structural wall measured), and walls attached to floors or ceilings rather than roofs.

## Maintainer notes (landing)

- Landed as one commit authored by puzzbobb, rebased onto `main`. The probe and the report are his. In the report, the archive is called `R2025_Models.zip` throughout, the name it has on #356. Its artefacts line notes the runner reproduction, and §6 gains the Measure command. A CHANGELOG entry under Research credits him.
- Reproduced on GitHub's runners: #805 pinned the archive, and Measure run [39175059258](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39175059258) (`-f r2025=true -f probe=probe_re185_wall_function`) gives the tables above exactly. RE1 Architecture: 8 and 7 equal. The 21 models: 117 walls, all equal. Models 12 to 17: the `0.5h` entries 12482 × 18 and 12220 × 9.
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.

IFC export: write Revit's Level, Base Level, Base Constraint, Top Constraint and Reference Level as properties

2 participants