Skip to content

feat-2019-2022 - #741

Closed
puzzbobb wants to merge 2 commits into
DrunkOnJava:mainfrom
puzzbobb:feat-2019-2023
Closed

puzzbobb wants to merge 2 commits into
DrunkOnJava:mainfrom
puzzbobb:feat-2019-2023

Conversation

@puzzbobb

@puzzbobb puzzbobb commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

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-ifc on Autodesk's 2019 rac_basic writes the spatial scaffold and nothing else.

The records are 2023's. For every record marker, examples/probe_re178_revit_2019_2022.rs looks back for a declared u32 ElementId with ElementHeader's tag 8 bytes after it. On Autodesk's 2019, 2020, 2021 and 2022 rac_basic, rst_basic and rac_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:

use class 2019 2020 2021 2022 2023
element data CellList 0x0264 0x026c 0x027d 0x028d 0x02c0
material object Material 0x0924 0x094d 0x094b 0x09af 0x09fb
material name end PhysicalParamSet 0x0aef 0x0b24 0x0b25 0x0b90 0x0beb
category material PatternHelper 0x01ca 0x01d0 0x01e1 0x01f0 0x013f
layers VerticalRegionsStructure 0x0f37 0x0f76 0x0f79 0x1003 0x106f

Two layouts differ:

  • Wall flip. Revit 2019 and 2020 write a wall's flip right after its location line, with no word in between (03 00 00 00 · 00 01 ff ff against 2021's 03 00 00 00 · 01 00 00 00 · 00 01 ff ff). Read with the word, 14 of rac_basic's 40 walls and all 7 of rst_basic's had no exterior side.
  • One-unit names. In 32-bit data a list of one id, 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:

model elements, old / 2023 same id and class fields agree differ
rac_basic 2019 / 2020 / 2021 / 2022 622 / 637 / 637 / 638 of 639 all shared 6,569 to 6,629 43
rst_basic 2019 / 2020 / 2021 / 2022 529 / 544 / 544 / 545 of 546 all shared 6,707 to 6,832 70 / 70 / 5 / 70
rac_advanced 2021 / 2022 5,839 / 5,840 of 5,841 5,839 63,289 / 63,313 115 / 91
rac_advanced 2019 / 2020 5,773 / 5,788 of 5,841 5,755 61,663 994

Every 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 2020 rac_advanced are 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):

  • Type names on 8 walls and 2 ceilings, where 2019 to 2022 agree with the 2024 or 2026 copy and 2023 does not.
  • 2 plumbing fixtures without a type. Their family lists two named subcategories on 2019 to 2022.
  • RE-113's type-material scan, which has no per-release constant.
  • Raw reference lists.
  • 12 walls on 2021 rac_advanced with two saved copies whose lines disagree.

The 2019 to 2022 exports of rac_basic and rst_basic have 2023's building elements, class for class. All 18 exports made here (the samples, the 2019 rme and rst_advanced files 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 --check and cargo clippy --all-targets -D warnings are clean.

Overlap with #738. #738 reads a 2023 record's container as the u32 22 bytes before the marker. It edits partition_element_records_2023.rs, as this does, so the two will conflict in that file's imports and decode_at_marker. Once both are in, its reading applies to 2019 to 2022 as well; it is not measured on those releases here.

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.
@puzzbobb
puzzbobb requested a review from DrunkOnJava as a code owner October 7, 2026 08:42
**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.
@puzzbobb puzzbobb closed this Oct 8, 2026
@puzzbobb
puzzbobb deleted the feat-2019-2023 branch October 8, 2026 07:03
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.
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