ifc-element-type
Element, resource, and process type definitions: the IfcTypeObject catalogue.
| Status | Implemented |
| Latest release | 0.3.0 (2026-09-29) |
| Registries | crates.io ifc-element-type |
| Via the facade | openbim-ifc feature element-type |
| API documentation | rustdoc · docs.rs |
| Source | crates/ifc-element-type/ |
Overview
Element, resource, and process type definitions.
An IFC model separates what a thing is from where it sits. The type definition carries the shared description: a pump type names the pump model, and every pump placed from it inherits that.
This crate owns the 132 concrete IfcTypeObject subtypes. They sit in one crate because they are one uniform shape with one shared WHERE rule, not because they are one domain: the list spans HVAC, structure, furniture, resources and processes. Splitting them across domain crates would copy the same rule and the same slot table into a dozen places.
The catalogue in table is generated from the schema by scripts/gen-element-types.py; create_type is the writer. It takes no model and writes the catalogue's IFC4X3 layout; create_type_in and create_type_with_owner_history write the model's declared release, which IFC2X3 needs for its required OwnerHistory (#202).
Depends on
Changes
Latest release, 0.3.0 (2026-09-29):
Added
TypeDraftfields for the type-specific attributes IFC4 and IFC4X3 require (#214):operation_typeanduser_defined_operation_type(IfcDoorType),partitioning_typeanduser_defined_partitioning_type(IfcWindowType),parameter_takes_precedence(both),event_trigger_typeanduser_defined_event_trigger_type(IfcEventType), andassembly_place(IfcFurnitureType, IFC2X3 too). Tokens are checked against the bound release's enumeration (Invalidotherwise); a value for an attribute the type does not declare is refused withAuthoringNotInSchema;USERDEFINEDevent_trigger_typewithout a non-blankuser_defined_event_trigger_typeis refused (CorrectEventTriggerType). These four types can now be authored in every release that declares them.TypeDraft::newandSupertypeDraft::new, and one builder setter per field, named after it (TypeDraft::new().name("Beam").tag_or_long_description("B-1")).
Fixed
create_type(andcreate_supertype), which take no model, no longer write$into an attribute IFC4X3 requires: a required attribute left unset is refused withAuthoringRequired, staging nothing, as the model-bound writers already did (#214).
Changed (breaking)
TypeDraftandSupertypeDraftare#[non_exhaustive]: struct literals outside the crate no longer compile. Usenew()(ordefault()) and the setters; the fields stay public for reading and assignment.create_typerefusesIfcDoorType,IfcWindowType,IfcEventTypeandIfcFurnitureTypewithout their required type-specific attribute, where it wrote$before.Slot6,Family,ElementTypeandSupertypeKindare#[non_exhaustive]: amatchonFamilyorSlot6needs a wildcard arm, and catalogue rows can no longer be built by struct literal outside the crate (use the generated constants).
Changed
- Depends on
ifc-schemawith its default features named explicitly (every bundled release), now that the workspace dependency turns them off for the facade's per-release features (#112). - A model whose header declares
IFC4X1orIFC4X2is refused with the existing unsupported-schema error.ifc-schemanow bundles both releases, but no layout here is verified against them, so they are never read as IFC4 or IFC4X3.
Full history: crates/ifc-element-type/CHANGELOG.md