Repository navigation
feat-2019-2022 - #741
Closed
puzzbobb wants to merge 2 commits into
Closed
feat-2019-2022#741puzzbobb wants to merge 2 commits into
puzzbobb wants to merge 2 commits into
Conversation
feat(elements): export Revit 2019 to 2022 projects from their records, in 2023's 32-bit layout (RE-178, DrunkOnJava#421) Revit 2019 to 2022 projects exported no building element: the 32-bit record path was gated to 2023. On Autodesk's 2019 to 2022 sample projects every record marker has a declared u32 ElementId 52 bytes before it and ElementHeader's tag 8 bytes after that, as on 2023 (all but 4 to 11 per file, the same few as on the 2023 copy), so the 2023 readers read them. Every constant those readers hold is 2023's tag of a schema class, and each release takes its own tag of the same class (schema_tags): CellList, Material, PhysicalParamSet, PatternHelper and VerticalRegionsStructure. Revit 2019 and 2020 write a wall's flip right after its location line, with no word between them; read with the word, 14 of rac_basic's 40 walls and all 7 of rst_basic's had no exterior side. In 32-bit data a one-id list, u32 1 · u32 id, reads as a one-unit name: a name entry of one non-ASCII character, and on 2019 to 2022 an element-data name of one character, is no longer taken. That names 10 lighting fixtures' type, drops a false `p` wall type and a false `퉼` ceiling type, and gives 4 walls and 2 ceilings the type their 2024 or 2026 copies give. There is no Revit export of a 2019 to 2022 file to measure against; the oracle is the same model saved by Revit 2023. On rac_basic, rst_basic and rac_advanced of 2019, 2020, 2021 and 2022, every ElementId shared with the 2023 copy has its class there. The field differences are model edits between releases, RE-113's type-material scan, two plumbing fixtures without a type, and type names where the later copies side with 2019 to 2022. The exports have 2023's building elements class for class and pass IfcOpenShell 0.9.0's schema validation. The IFC export of 80 local files of 2008 to 2027 is byte-identical. - partition_element_records_2023: REVIT_32BIT_RELEASES, is_32bit_release, SchemaTags32 and schema_tags. - partition_names: element_data_header_32, find_element_data_names_32, lone_non_ascii. - partition_compound_structure: 2019 to 2022 layer layout, frame tag and wall lines; wall_orientation_has_word, wall_orientation_with. - partition_materials: scan_materials_32 and per-release tags for material objects, names, appearances and category materials. - partition_type_materials::type_material_names_32; level records, room solids and the export pipeline admit 2019 to 2022. - RE-178 report and probe; README, supported profile, support matrix (element-records-revit-2019-2022, experimental), CHANGELOG.
**Update 2: Revit 2014 to 2018 are admitted as well (RE-179).** A second commit extends the same 32-bit path back to 2014. Each change below applies only to 2014 to 2018, and 2019 onwards reads as before. **The records are 2019's.** `examples/probe_re179_revit_2014_2018.rs` finds a declared `u32` ElementId 52 bytes before every record marker of Autodesk's 2016, 2017 and 2018 `rac_basic`, `rst_basic` and `rac_advanced`. Each file has the same few exceptions as its 2019 copy. Three 2015 templates and a 2014 project frame their records the same way. `schema_tags` gains rows for 2014 to 2018. **Four things differ from 2019:** - **Level placement kind.** A 2014 to 2018 Level record holds `0xffffef6f` where 2019 holds the instance kind `0xffffef7f`. Without this, no Level was a storey and no element was bound to its Level. - **Wall flip.** There is no word before the flip, as on 2019 and 2020. - **Material shading.** A material's shading frame holds 2 pattern slots, where 2019 holds 4: Revit 2019 split each fill pattern into foreground and background. Without this, no material had a colour. - **Element-data names.** A type's name is now read only from the type's own data, up to the next element's header, and one-unit entries are skipped. Without this, 9 walls of the 2018 `rac_basic` had an ambiguous type and 5 roofs of the 2016 samples had none. **Measured** against the 2019 copy of each sample (⚠️ there is no Revit export of a 2014 to 2018 file): | model | 2016 | 2017 | 2018 | |---|---|---|---| | `rac_basic`, fields agree / differ | 6,534 / 63 | 6,590 / 7 | **6,597 / 0** | | `rst_basic` | 6,411 / 224 | 6,623 / 73 | 6,623 / 73 | | `rac_advanced` | 62,795 / 12 | 62,806 / 1 | **62,807 / 0** | - Every shared ElementId has the same class in both files. - Every remaining difference is in the files' own bytes: element boxes, reference lists, 2016's shading colours, and families renamed in the 2016 `rst_basic` (RE-179 §6). - The exports have the 2019 copies' building elements, class for class. - 18 exports pass IfcOpenShell 0.9.0's schema validation with no issue. - The IFC export of 91 of 92 local 2008 to 2027 files is byte-identical to the first commit's. The one that changes is the 2016 sample family, now read from its records. - `cargo fmt --check` and `cargo clippy --all-targets -D warnings` are clean. - `cargo test --test integration`: 261 passed and 1 failed. The failure is `synthetic_project_emits_valid_ifc4`, which fails the same way without this commit.
DrunkOnJava
pushed a commit
that referenced
this pull request
Oct 18, 2026
… layout (RE-180, RE-181) (#742) ## Revit 2015 to 2023 element records (RE-180, RE-181, #421) Follows #741 (Revit 2019 to 2022, RE-180, folded into this PR) and is made on top of it. Revit 2015 to 2018 write their element records in the same 32-bit layout as 2019 to 2023, so the readers from #741 now read them too, using each release's own schema tags. Before this change, a 2015 to 2018 project exported no building element. ### What changes - `REVIT_32BIT_RELEASES` is now 2015 to 2023, and `schema_tags` gains rows for 2015 to 2018. Each release's tags were read from its own schema. (2014 is left out; see the maintainer notes.) - **Level placement kind.** A 2015 to 2018 Level record holds `0xffffef6f` where 2019 and later hold the instance kind `0xffffef7f`. Without this, no Level became a storey and no element was bound to its Level. `LEVEL_PLACEMENT_KIND_2015` now reads as the instance kind. - **Wall flip.** As on 2019 and 2020, 2015 to 2018 write no word between a wall's location line and its flip. - **Material shading.** The frame holds two pattern slots where 2019 holds four, because 2019 split each fill pattern into foreground and background. Without this, no material had a colour. - **Element-data names (2015 to 2018 only).** A type's name is now looked for only in the type's own data, up to the next element's header, and one-unit entries are skipped. This fixes two cases: 9 walls of the 2018 `rac_basic` whose type was ambiguous, and 5 roofs of the 2016 samples that had no type. 2019 to 2023 are unchanged. ### Checked There is no Revit export of a 2015 to 2018 file. The oracle is the same Autodesk sample saved by Revit 2019. The samples are pinned in `research/autodesk-sample-projects.tsv`, and none is committed. | model | 2016 | 2017 | 2018 | |---|---|---|---| | `rac_basic`, fields agreeing / differing | 6,613 / 63 | 6,669 / 7 | **6,676 / 0** | | `rst_basic` | 6,411 / 224 | 6,623 / 73 | 6,623 / 73 | | `rac_advanced` | 62,795 / 12 | 62,806 / 1 | **62,807 / 0** | - Every ElementId that a release shares with its 2019 copy has the same class in both. - Every remaining field difference comes from the files' own bytes: element boxes, reference lists, 2016's shading colours, and 2016 `rst_basic`'s renamed families (RE-181 §6). - The IFC exports have the 2019 copies' building elements, class for class. The 2018 `rac_basic` and the 2017 and 2018 `rac_advanced` exports match the 2019 exports line for line, apart from GlobalIds. - 18 exports pass IfcOpenShell 0.9.0's schema validation with 0 issues: the 9 samples, the 2019 copies, three 2015 templates, the 2016 sample family and a 2014 project (which is not evidence and is no longer read). - The IFC export is byte-identical to #741's on 91 local files of 2008 to 2027. Only the 2016 sample family changes, because it is now read from its records. - `cargo fmt --check` and `cargo clippy --all-targets -D warnings` are clean. - `cargo test --test integration` with the local corpus: 261 passed and 1 failed. The failure is `synthetic_project_emits_valid_ifc4`, which fails the same way on #741's head. The table is the runners' (maintainer notes). Autodesk's six 2015 sample projects (pinned by #801) frame their records as 2019 does and carry the 2015 tags, and on five of them every ElementId shared with the 2019 copy has its class. The sixth, `rst_basic`, is another model (RE-181 §6). ### Limits - Autodesk publishes no 2014 sample project, and Revit 2014 is not read, since its one project's origin is not documented. - Revit 2013 and earlier are not covered. Report: `reports/element-framing/RE-181-revit-2015-2018-element-records.md`. Probe: `examples/probe_re181_revit_2015_2018.rs`. The 2019 to 2022 report and probe are `RE-180-revit-2019-2022-element-records.md` and `probe_re180_revit_2019_2022.rs`. ## Legal and contribution hygiene The changes in this PR are based on byte observations of Revit files (CLEANROOM.md Accepted sources 1): Autodesk's public sample projects `rac_basic`, `rst_basic` and `rac_advanced` of 2016 to 2019, as pinned in `research/autodesk-sample-projects.tsv`; Autodesk's `rac_basic_sample_family-2016.rfa` as the phi-ag/rvt corpus holds it; three Autodesk Revit 2015 templates; and one local Revit 2014 project. 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. I agree this work is licensable under Apache-2.0. The 2015 files are Autodesk's own templates shipped with Revit 2015 (build 20140117_1515), unmodified; the 2014 project is a local file whose origin cannot be documented. (puzzbobb, [comment](#742 (comment))) ## Maintainer notes (landing) - **Revit 2014 is left out, as the contributor asked (fail closed).** No documented 2014 file backs it. So `REVIT_32BIT_RELEASES` is 2015 to 2023, the 2014 row of `schema_tags` is removed, and every release list and range this PR adds starts at 2015. `LEVEL_PLACEMENT_KIND_2014` is named `LEVEL_PLACEMENT_KIND_2015`. The RE-181 report keeps the 2014 measurements, marked as not evidence. - **Renumbered** RE-178 to RE-180 and RE-179 to RE-181. RE-172 to RE-178 are helenkwok's PRs and RE-179 is #740's. That covers the reports, the probes, code comments, the support-matrix entries (`element-records-revit-2015-2018`), the CHANGELOG, README and supported profile. Only lines this PR adds were changed. - **Rebased onto `main`** after #740, as one signed commit with puzzbobb as author; the merge commits are dropped. The 2027 lines this branch carried from #740 come from #740 itself, as the review said they would. Apart from the 2014 removal and the renumbering, each source file's added and removed lines are the PR's own, checked line by line against the branch's changes. The one exception is a list rustfmt rewrapped. - **Reproduced on the runners.** Measure run [39161812159](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39161812159) (`-f samples=true`, base `main`) read Autodesk's 49 sample projects and CI's 6 reference models. - `rac_basic` 2016 to 2022 export 464 building elements and `rst_basic` 454, where `main` exports none; each equals its 2023 copy, class for class. - `rac_advanced` 2021 and 2022 export 5,657, as 2023 does. 2016 to 2020 export 5,606: 36 `IfcMember`, 5 `IfcSlab` and the 10 `IfcStairFlight` fewer, which RE-180 §6 explains as an earlier edit of the model. - Every 2024 to 2027 output and every reference model is byte-identical. Of the 2023 samples, only `rac_advanced` changes: 2 more entities and 2 more property values, from the one-unit name rule, which 2023 shares. - **Two claims corrected to that measurement.** The CHANGELOG said "every 2023 to 2027 export is byte-identical" and gave every 2019 to 2022 export 2023's building elements. Both now say what Measure shows, and RE-180 §8 records the 2023 `rac_advanced` change. - **Every table reproduced on the runners with Measure's paired probe** (#799): runs [39164970308](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39164970308) for 2019 to 2022, [39164971874](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39164971874) for 2016 to 2018, and [39173916922](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39173916922) for 2015 and the 2019 MEP and `rst_advanced` projects. - Every marker count, every schema tag, and every `rst_basic` and `rac_advanced` row is exactly the contributor's. - On `rac_basic` the runners read one element fewer in both files and 79 more agreeing fields, at this commit and at both earlier heads (057f27a, 97cf970). Those rows of RE-180 §6 and RE-181 §6, and the table above, are the runners'. - The 2015 rows of RE-181 come from Autodesk's six 2015 sample projects, which #801 pinned, and no longer from templates only. The four 2019 counts in RE-180 §7 reproduce exactly.
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.
Update: Revit 2019 to 2022 are admitted as well (RE-178). This commit sits on top of the 2027 work and adds the releases before 2023.
Before. A 2019 to 2022 project opens and its schema reads, but the 32-bit record path stops at 2023.
rvt-ifcon Autodesk's 2019rac_basicwrites the spatial scaffold and nothing else.The records are 2023's. For every record marker,
examples/probe_re178_revit_2019_2022.rslooks back for a declaredu32ElementId withElementHeader's tag 8 bytes after it. On Autodesk's 2019, 2020, 2021 and 2022rac_basic,rst_basicandrac_advanced, it finds one exactly 52 bytes back, as on 2023, at every marker but 4 to 11 per file (the 2023 copies have the same few), and at no other distance. The 2023 reader therefore reads them unchanged.The constants. Every constant the 2023 readers hold is 2023's tag of a schema class, and 2024's counterpart is 2024's tag of the same class. Each release takes its own tag (
schema_tags), the same on every file of the release:CellListMaterialPhysicalParamSetPatternHelperVerticalRegionsStructureTwo layouts differ:
03 00 00 00 · 00 01 ff ffagainst 2021's03 00 00 00 · 01 00 00 00 · 00 01 ff ff). Read with the word, 14 ofrac_basic's 40 walls and all 7 ofrst_basic's had no exterior side.u32 1 · u32 id, reads as a one-unit name. On 2019 it gave type 754016 a second name,U+FDCE, so 10 lighting fixtures had no type. On 2019 to 2022 it also named a ceiling type퉼and made "Working Drawings" (p) a wall type. A name entry of one non-ASCII character is no longer taken, and on 2019 to 2022 neither is a one-character element-data name. 4 walls and 2 ceilings then get the type their 2024 or 2026 copy gives (Wall - Timber Clad,Furred Ceiling), where 2023 gives none. 2023 keeps its reading: with the same rule there, 5 walls would take a type their 2024 copy does not confirm.Measured.⚠️ There is no IFC Revit export of a 2019 to 2022 file to measure against. The oracle is the same Autodesk model saved by Revit 2023, which RE-81 to RE-116 measured against Revit's exports. The probe compares production elements by ElementId:
rac_basic2019 / 2020 / 2021 / 2022rst_basic2019 / 2020 / 2021 / 2022rac_advanced2021 / 2022rac_advanced2019 / 2020Every ElementId that both files hold has the same class. The ids only one file holds are not in the other file's
ElemTable: Revit added analytical materials on upgrade, and the 2019 and 2020rac_advancedare an earlier edit whose stairs were rebuilt under new ids and whose curtain walls moved 7.5 mm. The other differences (details in RE-178 §6):rac_advancedwith two saved copies whose lines disagree.The 2019 to 2022 exports of
rac_basicandrst_basichave 2023's building elements, class for class. All 18 exports made here (the samples, the 2019rmeandrst_advancedfiles and three other 2019 models) pass IfcOpenShell 0.9.0's schema validation with no issue.Nothing else moves. The IFC export of 80 local files of 2008 to 2027 is byte-identical to the 2027 commit's, including every 2023 file.
cargo fmt --checkandcargo clippy --all-targets -D warningsare clean.Overlap with #738. #738 reads a 2023 record's container as the
u3222 bytes before the marker. It editspartition_element_records_2023.rs, as this does, so the two will conflict in that file's imports anddecode_at_marker. Once both are in, its reading applies to 2019 to 2022 as well; it is not measured on those releases here.