Skip to content

ifc-element-type ​

Element, resource, and process type definitions: the IfcTypeObject catalogue.

StatusImplemented
Latest release0.3.0 (2026-09-29)
Registriescrates.io ifc-element-type
Via the facadeopenbim-ifc feature element-type
API documentationrustdoc · docs.rs
Sourcecrates/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 ​

  • TypeDraft fields for the type-specific attributes IFC4 and IFC4X3 require (#214): operation_type and user_defined_operation_type (IfcDoorType), partitioning_type and user_defined_partitioning_type (IfcWindowType), parameter_takes_precedence (both), event_trigger_type and user_defined_event_trigger_type (IfcEventType), and assembly_place (IfcFurnitureType, IFC2X3 too). Tokens are checked against the bound release's enumeration (Invalid otherwise); a value for an attribute the type does not declare is refused with AuthoringNotInSchema; USERDEFINED event_trigger_type without a non-blank user_defined_event_trigger_type is refused (CorrectEventTriggerType). These four types can now be authored in every release that declares them.
  • TypeDraft::new and SupertypeDraft::new, and one builder setter per field, named after it (TypeDraft::new().name("Beam").tag_or_long_description("B-1")).

Fixed ​

  • create_type (and create_supertype), which take no model, no longer write $ into an attribute IFC4X3 requires: a required attribute left unset is refused with AuthoringRequired, staging nothing, as the model-bound writers already did (#214).

Changed (breaking) ​

  • TypeDraft and SupertypeDraft are #[non_exhaustive]: struct literals outside the crate no longer compile. Use new() (or default()) and the setters; the fields stay public for reading and assignment.
  • create_type refuses IfcDoorType, IfcWindowType, IfcEventType and IfcFurnitureType without their required type-specific attribute, where it wrote $ before.
  • Slot6, Family, ElementType and SupertypeKind are #[non_exhaustive]: a match on Family or Slot6 needs 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-schema with 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 IFC4X1 or IFC4X2 is refused with the existing unsupported-schema error. ifc-schema now 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

Released under the AGPL-3.0-or-later licence. ISO and CEN standards material is not redistributed.