Skip to content

feat(elements): read Revit 2023 Levels as storeys and contain each element in its Level's (#421) (RE-107) - #480

Merged
DrunkOnJava merged 1 commit into
mainfrom
feat/levels-2023
Sep 28, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
feat/levels-2023

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Revit 2023 Levels and the storeys elements sit on (RE-107, #421).

  • The elevation marker. RE-51's marker is 05 00 00 00 and a per-release u16: 0x0248 on 2024, 0x025d on 2025. That u16 is the tag of the schema class Plane, 0x0235 on 2023. It is read from the schema where no release constant is recorded.

  • The 2023 Level record. It is 2024's without the 24 sentinel bytes after the category, opened by 2023's 32-bit chain header (RE-81). Relative to the category:

    • the u32 id is 14 bytes before;
    • the container is 8 bytes after, the placement kind 24 after, the record marker 38 after.

    Its name block has a u32 owner and a 28-byte sentinel run.

  • The newest copy. A Level edited after an earlier save is rewritten into a higher-numbered partition, as every element is (RE-26 §3), so only its newest partition's block counts. modelo_bim's Fundação is −4.0 m in Partitions/1 and −1.7 m, Revit's, in Partitions/2.

  • The storey-set check counts distinct Levels.

  • Containment. 2023 elements bind to the Level their u32 reference list names, with RE-59's base constraint and RE-68's rules. Each element keeps its newest frame: four modelo_bim columns are framed from −13.12 ft in Partitions/1 and from −5.58 ft in Partitions/2, and Revit draws them from −1.7 m.

Results

against Revit's IFC4 storeys (name and elevation) elements in Revit's storey
Exemplo_data 2 of 2 (main: 1 derived storey) 37 of 37 (main: 0)
modelo_bim 4 of 4 (main: 2 derived storeys) 29 of 37 (main: 0)

Left on modelo_bim:

  • 4 beams whose record names only Nível 1, where Revit uses Nível 2;
  • 4 foundation beams that name no Level.

Revit_IFC5_Einhoven.rvt fails closed: only one Level record is found, so its storeys stay as before. Its elements now carry the Level their records name, as 2024's do.

The storeys' GlobalIds are not Revit's on 2023 (RE-48's reader does not run there).

Changes

  • src/partition_level_records.rs:
    • schema_elevation_marker and find_level_records_2023;
    • the name block generalised to a 32-bit owner (OWNER_SENTINEL_RUN_LEN_2023);
    • the newest-partition block rule and the distinct-Level count;
    • 2023 added to the supported releases.
  • src/partition_schema_mvp.rs:
    • 2023 records bind to Levels;
    • RE-59 and RE-68's storey rules run on 2023;
    • select_newest_instance_records.
  • src/ifc/mod.rs: the 2023 diagnostics warning.
  • The existing release test in partition_level_records now expects 2023 supported.
  • reports/element-framing/RE-107-levels-2023.md, README, status, supported profile, support matrix, CHANGELOG.

Testing

Unit tests are banned in this repository; none were added.

  • Gates: fmt, clippy -D warnings, rustdoc -D warnings, cargo +1.85.0 check, fuzz workspace check (--locked), and tools/ci/verify-real-files.sh --profile ci with both corpora.
  • End to end: tools/re/storeys_vs_ifc.py -v against Revit's own exports of both 2023 projects (local only, no licence, sha256 in the report).
  • Every 2024 and 2025 local file is byte-identical to main's apart from the timestamp, so no witness observation changes:
    • Core Interior, the four RE1 models;
    • Snowdon Towers and its structural model;
    • Projeto1, teste_export_2025, the MIT house (2024, 2025).

Legal and contribution hygiene

  • Apache-2.0. Byte observations and comparisons with Revit's exported IFC; no Autodesk code.

Breaking changes

None.


Note

Medium Risk
Changes partition decoding and IFC storey containment for 2023 projects; 2024/2025 are regression-checked for byte identity, but 2023 exports can still fail closed or mis-assign storeys when Level data is incomplete.

Overview
Revit 2023 IFC exports now recover Revit Levels as building storeys and place elements on the storey named in each element record’s reference list, using the same containment rules as 2024 (RE-59/RE-68).

Implementation adds 2023-specific Level record scanning (find_level_records_2023), schema-derived elevation markers via the embedded Plane class tag when no hard-coded release constant exists, and 32-bit name blocks (shorter 0xff sentinel runs). Edited Levels and duplicated element frames resolve by keeping the newest partition’s data; storey-set validation counts distinct Level ElementIds when a Level appears in multiple partitions. The 2023 MVP path loads partition levels, binds records to known Level ids, and runs select_newest_instance_records instead of the generic instance picker.

Docs, support matrix, CHANGELOG, and IFC diagnostics text are updated with measured parity (e.g. Exemplo_data 37/37 elements in Revit’s storey; modelo_bim 29/37 with known beam/Level gaps). 2024/2025 outputs stay byte-identical aside from timestamps.

Reviewed by Cursor Bugbot for commit 1fb5201. Configure here.

…ement in its Level's (#421) (RE-107)

A 2023 Level record is 2024's without the 24 sentinel bytes after its category, and its name block has a u32 owner and a 28-byte sentinel run. The elevation marker's u16 is the schema's Plane tag on every release. A Level's newest partition holds its current elevation, and 2023 elements keep their newest frame. Exemplo_data: 2 of 2 storeys and 37 of 37 elements as Revit's; modelo_bim: 4 of 4 and 29 of 37.
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) September 28, 2026 11:34
@cursor

cursor Bot commented Sep 28, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_19e7e20b-2079-4832-b4c5-bd5423010dd3)

@DrunkOnJava
DrunkOnJava merged commit dae6194 into main Sep 28, 2026
20 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/levels-2023 branch September 28, 2026 11:37
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