compas_ifc.entities
Internal IFC entity wrappers. The user-facing API does not require touching
these directly — see compas_ifc.bim and compas_ifc.element —
but they are documented for contributors and for advanced workflows that
need raw IFC entity access through element._ifc_entity.
Architecture
Every IFC entity loaded through compas_ifc is wrapped in a
Base. Direct attribute access proxies
through __getattr__() to the
underlying ifcopenshell.entity_instance. Inverse attributes are
exposed as zero-argument callables (wall.ContainedInStructure()) to
mark the syntactic distinction from direct attributes (wall.Name).
Type information for the IFC class hierarchy is provided through PEP 561
stubs at compas_ifc/entities/generated/{IFC2X3,IFC4,IFC4X3}.pyi.
These stubs are consumed by IDEs and type checkers; there is no runtime
class per IFC type. Schema-class attributes added by hand-written
extensions are merged into the matching stub class so they appear in
autocomplete alongside the EXPRESS-defined attributes.
Base
Root class for all IFC entity wrappers. |
|
Root class for all IFC type definitions. |
|
Register a class as an extension of one or more IFC classes. |
Extensions
Hand-written extensions registered via the
extends() decorator. Each adds
Python-friendly properties to entities of a particular IFC class.
Extras applied to entities of class |
|
Extras applied to entities of class |
|
Extras applied to entities of class |
|
Extras applied to entities of class |
|
Extras applied to entities of class |
|
Extras applied to entities of class |
|
Extras applied to IFC entities that act as spatial containers. |
|
Extras applied to entities of class |
|
Extras applied to entities of class |
Stub generator
The stub generator under compas_ifc.entities.generator writes one
.pyi file per supported schema. Run by maintainers when adding
support for a new IFC schema version; not typically invoked by users.
python -m compas_ifc.entities.generator
Generate a |