Skip to content

feat(ifc): give Revit 2023 elements Revit's own GlobalIds (#421) (RE-108) - #481

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

DrunkOnJava merged 1 commit into
mainfrom
feat/global-ids-2023

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Revit 2023 elements take Revit's own GlobalIds (RE-108, #421). RE-48 rebuilds the GlobalId Revit's exporter gives an element: the GUID of the episode that created it, with the ElementId XORed into its last 32 bits. It read the episode number from a 40-byte Global/ElemTable record (2024 and later, at +0x18).

A 28-byte record (Revit 2023) holds it at +0x0c: u32 · u32 id · u32 second id · u32 episode · …. The first word is ffffffff, the element's own id, or the element it is nested in. revit_global_ids now reads both layouts.

Results

against Revit's IFC4 (tools/re/global_ids_vs_ifc.py) elements storeys rooms
Exemplo_data 37 of 37 (main: 0) 2 of 2 9 of 9
modelo_bim 37 of 37 (main: 0) 4 of 4 none in the file

How the field was found:

  • For each exported element, the episode whose GUID gives Revit's GlobalId was searched for in Global/History, then its number in the element's record. It is at +0x0c on every one.
  • Opening elements are left out: they carry their door's or window's Tag but a GlobalId of Revit's own making.
  • modelo_bim's roof is written by Revit as an IfcRoof and four IfcSlab parts sharing its Tag; rvt-rs's roof takes the IfcRoof's GlobalId.

Changes

  • src/revit_global_ids.rs: RECORD_EPISODE_OFFSET_28, and the layout picked by record length.
  • tools/re/global_ids_vs_ifc.py; reports/element-framing/RE-108-global-ids-2023.md; README, 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 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.

Legal and contribution hygiene

  • Apache-2.0. Byte observations; no Autodesk code.

Breaking changes

None.


Note

Low Risk
Additive layout branch for 28-byte ElemTable records; 2024/2025 output is unchanged and wrong offsets would only yield empty or mismatched GlobalIds on 2023, not alter geometry or auth paths.

Overview
Revit 2023 IFC exports now use Revit's own GlobalIds for elements, rooms, and storeys, extending RE-48 instead of falling back to generated ids.

revit_global_ids used to bail out unless Global/ElemTable rows were 40 bytes (2024+). It now also accepts 28-byte 2023 records and reads the creating-episode number at +0x0c (2024 keeps +0x18), then applies the same Global/History GUID + ElementId XOR rule.

Docs and the support matrix note RE-108; tools/re/global_ids_vs_ifc.py scores rvt-rs vs Revit's IFC on the two measured 2023 projects. 2024/2025 exports stay byte-identical aside from timestamps.

Reviewed by Cursor Bugbot for commit f0a8cff. Configure here.

…108)

A 28-byte Global/ElemTable record holds the element's creating episode at +0x0c, where 2024's 40-byte record has it at +0x18. Every element, room and storey rvt-rs exports from the two 2023 projects with a Revit export now carries the GlobalId Revit gives it: Exemplo_data 37, 9 and 2; modelo_bim 37 and 4.
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) September 28, 2026 11:42
@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_837ee9d9-24a9-49f7-b72c-acadd182141e)

@DrunkOnJava
DrunkOnJava merged commit 650b92d into main Sep 28, 2026
20 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/global-ids-2023 branch September 28, 2026 11:44
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