Repository navigation
feat(elements): read Revit 2023 Levels as storeys and contain each element in its Level's (#421) (RE-107) - #480
Merged
Merged
Conversation
…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
enabled auto-merge (squash)
September 28, 2026 11:34
Bugbot couldn't run - usage limit reachedBugbot 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) |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Revit 2023 Levels and the storeys elements sit on (RE-107, #421).
The elevation marker. RE-51's marker is
05 00 00 00and a per-releaseu16:0x0248on 2024,0x025don 2025. Thatu16is the tag of the schema classPlane,0x0235on 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:
u32id is 14 bytes before;Its name block has a
u32owner 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/1and −1.7 m, Revit's, inPartitions/2.The storey-set check counts distinct Levels.
Containment. 2023 elements bind to the Level their
u32reference 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 inPartitions/1and from −5.58 ft inPartitions/2, and Revit draws them from −1.7 m.Results
Left on modelo_bim:
Revit_IFC5_Einhoven.rvtfails 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
schema_elevation_markerandfind_level_records_2023;OWNER_SENTINEL_RUN_LEN_2023);select_newest_instance_records.Testing
Unit tests are banned in this repository; none were added.
cargo +1.85.0 check, fuzz workspace check (--locked), andtools/ci/verify-real-files.sh --profile ciwith both corpora.tools/re/storeys_vs_ifc.py -vagainst Revit's own exports of both 2023 projects (local only, no licence, sha256 in the report).Legal and contribution hygiene
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 embeddedPlaneclass tag when no hard-coded release constant exists, and 32-bit name blocks (shorter0xffsentinel 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 runsselect_newest_instance_recordsinstead 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.