Skip to content

IFC export: write Revit's Level, Base Level, Base Constraint, Top Constraint and Reference Level as properties #750

Closed

Description

@helenkwok

rvt-rs writes no level parameters on exported elements. Revit's own IFC4 export carries them in the Constraints property set. Across 15 public Revit 2024 models (the eight Autodesk 2024 samples and Snowdon Towers), about 29,500 Level values are missing compared with Revit's export.

Every element has one record in the inflated Partitions/* streams (checksum pages stripped, every gzip member inflated) that opens d3 02 01 00 00 00, then u32 ElementId, u32 0, u32 LevelId, u32 0, then ff ff ff ff six times. LevelId (ElementId + 8) is the element's Level: a wall's Base Constraint, and for other categories the Level, Base Level, Reference Level or Schedule Level parameter.

A wall's Top Constraint is a second 0 | LevelId | 0 | ff.. group further into the record (seen 150 to 168 bytes after the start; the reader searches 100 to 320 bytes and takes the group only if its id is a recovered Level).

Measured against Revit's IFC4 export on seven public Revit 2024 samples (matched by Tag; equal / elements where Revit has the property): racadvanced Level 5214/5214, Base Constraint 180/180, Top Constraint 177/177; rmeadvanced Level 4151/4151, Reference Level 1216/1216; rstadvanced Level 502/502, Base Level 203/203. The other files agree in the same way (full table in the PR). On the record, shuffled-name controls were far lower (for example 3944 of 5421 on racadvanced against 5421).

Limits:

  • The field is 0xffffffff for beams, stairs, braces and some MEP terminals, whose level is stored elsewhere. Nothing is written for them.
  • Top Constraint coverage is partial: the offset of the group varies (150, 152, 156, 164, 168 seen) and walls whose group is not found get none. Where it is found it was exact (racadvanced 126/126, DACH 259/259, Snowdon 574/574, measured with a standalone scanner).
  • Revit 2024 only. The DACH and Snowdon Architectural samples export no elements on main (ElementId layout not located, RE-30), so nothing changes for them.

The change is additive: storey containment, LevelElementId and the level binding of RE-27, RE-59, RE-60 and RE-68 are untouched, and storey containment and element counts are identical to main on every file measured.

Clean-room: this finding comes from public Autodesk Revit 2024 sample files with Revit's own IFC4 export as the oracle and exported symbol names only; no SDK source and no decompiled or disassembled code was used.

Measured follow-ups (not in the PR)

The same record could also help storey placement, but not as a replacement for the current binding. On Snowdon Architectural (v0.4.0) rvt-rs agrees with Revit's storey on 513 elements where the record's Level differs, because Revit's export puts curtain-wall parts and openings on a storey other than their Level. Two narrow uses look safe. Both were measured against Revit's IFC4 storey containment, matched by Tag, on main 120e2f9:

These belong in separate PRs, if wanted.

Activity

  1. added
    type:feature
    area:ifc
    priority:P2
    on Oct 18, 2026
  2. added a commit that references this issue on Oct 18, 2026
    3f63306
  3. DrunkOnJava commented on Oct 18, 2026

    @DrunkOnJava
    Owner

    This shipped in v0.5.0 with your #751: the Constraints set carries Level, Base and Top Constraint and Reference Level. v0.5.1 is the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ifcpriority:P2type:feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions