extends

compas_ifc.entities.base.extends(*ifc_classes, schemas=None)

Register a class as an extension of one or more IFC classes.

The decorated class becomes part of the synthetic class composed by Base.__new__() whenever the underlying IFC entity satisfies entity.is_a(<ifc_class>). When schemas is provided, the extension is only applied for entities loaded from a file that uses one of the listed schemas.

Parameters:
*ifc_classesstr

One or more IFC class names this extension applies to.

schemasset of str, optional

Restrict the extension to specific IFC schemas (for example {"IFC4", "IFC4X3"}). Defaults to all schemas.

Examples

>>> from compas_ifc.entities.base import Base, extends
>>> @extends("IfcElement")
... class IfcElementExtras(Base):
...     pass