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

Function get_space_data

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

Source from the content-addressed store, hash-verified

391
392
393def get_space_data(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance) -> dict[str, Any]:
394 floor_name = None
395 floor = ifcopenshell.util.element.get_aggregate(element)
396 if floor and floor.is_a("IfcBuildingStorey"):
397 floor_name = val(floor.Name)
398
399 room_tag = None
400 room_tag_names = {"RoomTag", "Tag", "Room Tag"}
401 usable_height = None
402 usable_height_names = {"FinishCeilingHeight", "Height", "UsableHeight"}
403 gross_area = None
404 gross_area_names = {"GrossFloorArea", "GSA"}
405 net_area = None
406 net_area_names = {"NetFloorArea", "GSA"}
407 for _, props in ifcopenshell.util.element.get_psets(element).items():
408 for name, value in props.items():
409 if not room_tag and name in room_tag_names and val(value):
410 room_tag = str(value)
411 if not usable_height and name in usable_height_names and val(value):
412 usable_height = str(value)
413 if not gross_area and name in gross_area_names and val(value):
414 gross_area = str(value)
415 if not net_area and name in net_area_names and val(value):
416 net_area = str(value)
417
418 return {
419 "Name": val(element.Name),
420 "CreatedBy": get_created_by(element),
421 "CreatedOn": get_created_on(element),
422 "Category": get_category(element),
423 "FloorName": floor_name,
424 "Description": val(element.LongName),
425 "ExternalSystem": get_external_system(element),
426 "ExternalObject": element.is_a(),
427 "ExternalIdentifier": element.GlobalId,
428 # Stopped here
429 "RoomTag": room_tag,
430 "UsableHeight": usable_height,
431 "GrossArea": gross_area,
432 "NetArea": net_area,
433 }
434
435
436def get_zone_data(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance) -> dict[str, Any]:

Callers

nothing calls this directly

Calls 7

valFunction · 0.70
get_created_byFunction · 0.70
get_created_onFunction · 0.70
get_categoryFunction · 0.70
get_external_systemFunction · 0.70
is_aMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected