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

Function get_floor_data

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

Source from the content-addressed store, hash-verified

352
353
354def get_floor_data(ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance) -> dict[str, Any]:
355 height_names = {
356 "Height",
357 "NetHeight",
358 "GrossHeight",
359 "Net Height",
360 "Gross Height",
361 "StoreyHeight",
362 "Storey Height",
363 "FloorHeight",
364 "Floor Height",
365 }
366
367 height = None
368 for _, props in ifcopenshell.util.element.get_psets(element).items():
369 if height is not None:
370 break
371 for name, value in props.items():
372 if name in height_names and val(value):
373 height = str(value)
374 break
375
376 elevation = getattr(element, "Elevation", "")
377 elevation = "" if elevation is None else str(elevation)
378
379 return {
380 "Name": val(element.Name),
381 "CreatedBy": get_created_by(element),
382 "CreatedOn": get_created_on(element),
383 "Category": get_category(element),
384 "ExternalSystem": get_external_system(element),
385 "ExternalObject": element.is_a(),
386 "ExternalIdentifier": element.GlobalId,
387 "Description": val(element.Description),
388 "Elevation": val(elevation),
389 "Height": height,
390 }
391
392
393def get_space_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
itemsMethod · 0.45
is_aMethod · 0.45

Tested by

no test coverage detected