Skip to content

feat(ifc): type every element named Family:Type by an IFC type object of its Revit type (RE-110) - #483

Merged
DrunkOnJava merged 1 commit into
mainfrom
feat/type-objects
Sep 28, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
feat/type-objects

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

rvt-rs now writes the IFC4 type layer Revit's own export writes. Every element that rvt-rs names Family:Type, and whose Revit type it reads, is typed through IfcRelDefinesByType by one type object per Revit type:

  • the occurrence's IFC4 type entity (IfcWallType, IfcDoorType, IfcColumnType, …);
  • named Family:Type;
  • Tag = the type's ElementId;
  • PredefinedType = the occurrence's;
  • GlobalId = the one the type's UniqueId gives (RE-48, RE-108).

Before this PR no type object was written for any release.

Measured per Tag against every element Revit's export types (tools/re/type_objects_vs_ifc.py):

file release Revit types typed same name same Tag same GlobalId
Core Interior 2024 854 854 854 854 438
Snowdon Towers Architectural (local) 2024 5,812 5,803 5,803 5,341 2,816
RE1 Architecture 2025 73 72 72 70 36
Exemplo_data (local) 2023 37 19 19 19 0
modelo_bim (local) 2023 37 31 31 31 4

The remaining differences are measured and explained in reports/element-framing/RE-110-type-objects.md:

  • Names: the English system-family name (RE-63) against the Portuguese exports.
  • Tags: Revit tags each curtain panel type with a panel's own id.
  • GlobalIds: Revit's exporter often splits one Revit type into several type objects.
    • Most are one per instance, whose GlobalId is the instance's with bit 0x08 of byte 10 flipped.
    • The rest have GlobalIds that are not stored in the file.
    • Nothing in the element records measured tells which instances Revit groups, so rvt-rs writes one type object per type.

Changes

  • export_content: records each element's type ElementId (TypedProductionAppend::element_type_ids).
  • ifc::IfcModel::element_type_ids; RevitGlobalIds::types gives each type its Revit GlobalId.
  • step_writer:
    • type_entity_for maps an occurrence to its IFC4 type entity with every declared attribute.
    • The writer emits one type object and one IfcRelDefinesByType per (type, entity).
    • Openings, spaces, reinforcing bars and railings are not typed. Revit's Snowdon export types none of its 131 railings.
  • The two Core Interior witness rvt-rs.json observations are refreshed.
  • Docs:
    • status, README, supported profile, the support matrix (new ifc-type-objects, two stale "no IfcWallType is written" notes corrected), CHANGELOG;
    • the forum draft's type bullet.

Verification

  • tools/ci/ifc_schema_arity.py passes on every output: Core, Snowdon, RE1, the four ribeiro files. --witness-agreement passes on Core.
  • tools/ci/witness-verdict.py passes both Core artifacts with all three replays matching.
  • fmt, clippy, rustdoc, MSRV 1.85, fuzz check and tools/ci/verify-real-files.sh --profile ci all pass.

Note

Medium Risk
Changes IFC STEP output shape and entity counts for all typed exports; behavior is witness-tested on Core Interior but GlobalId and entity choices can still diverge from Revit’s split type objects.

Overview
RE-110 adds the missing IFC4 type layer: elements that already export as Family:Type (with FamilyName / TypeName) now get one IfcWallType, IfcDoorType, IfcColumnType, etc. per Revit type, linked via IfcRelDefinesByType, with name Family:Type, Tag = type ElementId, shared PredefinedType, and Revit-derived type GlobalIds where available.

The pipeline records each instance’s type ElementId in IfcModel::element_type_ids (from export content / walker), fills RevitGlobalIds::types, and step_writer groups by (type_id, IFC type entity) through new type_entity_for. Openings, spaces, reinforcing bars, and railings stay untyped; types still have no property sets or representation maps.

Docs, CHANGELOG, support matrix (ifc-type-objects), Core Interior witness observations, tools/re/type_objects_vs_ifc.py, and RE-110 report are updated; 2025 element-record tests ignore *TYPE entities when checking Tag coverage.

Reviewed by Cursor Bugbot for commit 9dd3550. Configure here.

@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) September 28, 2026 12:11
@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_4dbf7cb3-99c1-44aa-aec9-fe68ef36f22d)

@DrunkOnJava
DrunkOnJava merged commit 0285bf9 into main Sep 28, 2026
20 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/type-objects branch September 28, 2026 12:13
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