API Documentation¶
-
class
ifcopenshell.entity_instance.entity_instance(e)¶ This is the base python class for all IFC objects.
An instantiated entity_instance will have methods of Python and the IFC class itself.
example:
ifc_file = ifcopenshell.open(file_path) products = ifc_file.by_type(“IfcProduct”)
print(products[0].__class__) >>> <class ‘ifcopenshell.entity_instance.entity_instance’>
print(products[0].Representation) >>> #423=IfcProductDefinitionShape($,$,(#409,#421))
-
get_info(include_identifier=True, recursive=False, return_type=<class 'dict'>, ignore=())¶ Return a dictionary of the entity_instance’s properties (Python and IFC) and their values.
example:
ifc_file = ifcopenshell.open(file_path) products = ifc_file.by_type(“IfcProduct”) obj_info = products[0].get_info() print(obj_info.keys())
>>> dict_keys(['Description', 'Name', 'BuildingAddress', 'LongName', 'GlobalId', 'ObjectPlacement', 'OwnerHistory', 'ObjectType', >>> ...'ElevationOfTerrain', 'CompositionType', 'id', 'Representation', 'type', 'ElevationOfRefHeight'])
-
-
class
ifcopenshell.file.file(f=None, schema=None)¶ Base class for containing IFC files.
Class has instance methods for filtering by element Id, Type, etc.
Instantiated objects can be subscripted by Id or Guid
example:
ifc_file = ifcopenshell.open(file_path) products = ifc_file.by_type(“IfcProduct”)
print(products[0].id(), products[0].GlobalId) >>> 122 2XQ$n5SLP5MBLyL442paFx
# Subscripting print(products[0] == ifc_file[122] == ifc_file[‘2XQ$n5SLP5MBLyL442paFx’]) >>> True
-
by_guid(guid)¶ Return IFC objects filtered by IFC GUID.
Returned objects are unwrapped IFC objects.
-
by_id(id)¶ Return IFC objects filtered by IFC ID.
Returned objects are unwrapped IFC objects.
-
by_type(type)¶ Return IFC objects filtered by IFC Type and wrapped with the entity_instance class.
See ifcopenshell.entity_instance for class methods and properties
-
-
exception
ifcopenshell.validate.ValidationError¶