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

Function get_facility_data

src/ifcfm/ifcfm/cobie24.py:310–351  ·  view source on GitHub ↗
(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance)

Source from the content-addressed store, hash-verified

308
309
310def get_facility_data(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance) -> dict[str, Any]:
311 site = get_facility_parent(element, "IfcSite")
312 site_name = None
313 site_description = None
314 if site:
315 site_name = val(site.Name)
316 site_description = val(site.Description)
317
318 project = None
319 project_name = None
320 project_description = None
321 try:
322 project = ifc_file.by_type("IfcProject")[0]
323 project_name = val(project.Name)
324 project_description = val(project.Description)
325 except:
326 pass
327
328 return {
329 "Name": val(element.Name),
330 "CreatedBy": get_created_by(element),
331 "CreatedOn": get_created_on(element),
332 "Category": get_category(element),
333 "ProjectName": project_name,
334 "SiteName": site_name,
335 "LinearUnits": get_unit_type_name(ifc_file, "LENGTHUNIT"),
336 "AreaUnits": get_unit_type_name(ifc_file, "AREAUNIT"),
337 "VolumeUnits": get_unit_type_name(ifc_file, "VOLUMEUNIT"),
338 "CurrencyUnit": get_unit_type_name(ifc_file, "IfcMonetaryUnit"),
339 "AreaMeasurement": get_area_measurement(element),
340 "ExternalSystem": get_external_system(element),
341 "ExternalProjectObject": "IfcProject",
342 "ExternalProjectIdentifier": project.GlobalId if project else None,
343 "ExternalSiteObject": "IfcSite",
344 "ExternalSiteIdentifier": site.GlobalId if site else None,
345 "ExternalFacilityObject": "IfcBuilding",
346 "ExternalFacilityIdentifier": element.GlobalId,
347 "Description": val(element.Description),
348 "ProjectDescription": project_description,
349 "SiteDescription": site_description,
350 "Phase": val(project.Phase) if project else None,
351 }
352
353
354def get_floor_data(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance) -> dict[str, Any]:

Callers

nothing calls this directly

Calls 9

get_facility_parentFunction · 0.70
valFunction · 0.70
get_created_byFunction · 0.70
get_created_onFunction · 0.70
get_categoryFunction · 0.70
get_unit_type_nameFunction · 0.70
get_area_measurementFunction · 0.70
get_external_systemFunction · 0.70
by_typeMethod · 0.45

Tested by

no test coverage detected