MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / get_element_data

Function get_element_data

src/ifcfm/ifcfm/basic.py:149–173  ·  view source on GitHub ↗
(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance)

Source from the content-addressed store, hash-verified

147
148
149def get_element_data(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance) -> dict[str, Any]:
150 space = ifcopenshell.util.element.get_container(element)
151 space_name = space.Name if space.is_a("IfcSpace") else None
152 systems = ifcopenshell.util.system.get_element_systems(element)
153 system = systems[0].Name if systems else None
154 psets = ifcopenshell.util.element.get_psets(element)
155 return {
156 "Name": element.Name,
157 "TypeName": ifcopenshell.util.element.get_type(element).Name,
158 "SpaceName": space_name,
159 "SystemName": system,
160 "OrganizationName": get_owner_name(element),
161 "CreationDate": get_owner_creation_date(element),
162 "ModelSoftware": get_owner_application(element),
163 "ModelObject": "{}[{}]".format(element.is_a(), ifcopenshell.util.element.get_predefined_type(element)),
164 "ModelID": element.GlobalId,
165 "ModelTag": element.Tag,
166 "SerialNumber": get_property(psets, "Pset_ManufacturerOccurrence", "SerialNumber"),
167 "BarCode": get_property(psets, "Pset_ManufacturerOccurrence", "BarCode"),
168 "BatchReference": get_property(psets, "Pset_ManufacturerOccurrence", "BatchReference"),
169 "TagNumber": get_property(psets, "Pset_ConstructionOccurrence", "TagNumber"),
170 "AssetIdentifier": get_property(psets, "Pset_ConstructionOccurrence", "AssetIdentifier"),
171 "InstallationDate": get_property(psets, "Pset_ConstructionOccurrence", "InstallationDate"),
172 "WarrantyStartDate": get_property(psets, "Pset_Warranty", "WarrantyStartDate"),
173 }
174
175
176def get_system_data(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance) -> dict[str, Any]:

Callers 1

parseMethod · 0.70

Calls 10

get_owner_creation_dateFunction · 0.85
get_owner_applicationFunction · 0.85
formatMethod · 0.80
get_predefined_typeMethod · 0.80
get_owner_nameFunction · 0.70
get_propertyFunction · 0.70
get_containerMethod · 0.45
is_aMethod · 0.45
get_element_systemsMethod · 0.45
get_typeMethod · 0.45

Tested by

no test coverage detected