Skip to content

Preserve 64-bit Revit element IDs in reads and exports - #274

Merged
mahach666 merged 2 commits into
mainfrom
codex/64-bit-element-ids
Nov 19, 2026
Merged

mahach666 merged 2 commits into
mainfrom
codex/64-bit-element-ids

Conversation

@mahach666

@mahach666 mahach666 commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Change

Preserve exact signed 64-bit Revit element IDs from schema-declared tables and partition records through reading, lookup and export. Existing 32-bit APIs use document-local keys when remapping is necessary. The new signed 64-bit lookups and accessors expose exact source IDs for elements and references.

Full JSON carries the source-ID map and writes remapped references as decimal strings. Compact JSON keeps its existing string object IDs. Scene maintains local numeric geometry links and includes exact source IDs as text. IFC product tags carry source IDs.

Refs #269. Revit parity for UniqueId and IFC GUID remains open. Wide creation IDs are retained. The verified UInt32 derivation only applies within its supported range.

Synthetic verification

  • The synthetic RVT test reads the same project with native decoding and with the Revit 2022 layout rewrite. It checks exact type and host lookups, parameter references and creation IDs, including ID 2,147,483,648 and the distinct IDs 9, 4,294,967,305 and 9,007,199,254,741,001 with equal low 32 bits.
  • Assertions cover full and compact JSON, the Scene element-to-instance link and textual source IDs, and the exact IFC Tag. A test body is supplied after reading to exercise the geometry exporters.
  • Additional cases cover framed and scanned partition records, malformed tables, and retaining a wide creation ID without guessing a Revit UniqueId or IFC GUID.
  • All seven focused cases passed on both .NET 8 and .NET 10.

Byte-for-byte comparison

Exported two Revit 2027 fixtures with the same options and a fixed IFC timestamp using base 47e7776 and PR head 36ac652. All eight outputs compared byte for byte after merging main. The seven synthetic cases also passed again on .NET 8 and .NET 10.

Output Fixture 1 Fixture 2
IFC Identical Identical
Compact JSON Identical Identical
Full JSON Identical Identical
Scene JSON Identical Identical

Local checks

  • dotnet test RvtIO.slnx -c Release passed. .NET 8 had 10,941 passed and 447 skipped. .NET 10 had 10,945 passed and 447 skipped.
  • The native-core build of RvtIO.Scene passed on both frameworks.
  • git diff --check passed.

@mahach666
mahach666 marked this pull request as ready for review November 19, 2026 14:58
@mahach666
mahach666 merged commit dec9aa0 into main Nov 19, 2026
5 checks passed
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