mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Add feature to get parent of a particular IFC class
This commit is contained in:
@@ -440,13 +440,13 @@ def _get_element_value(element: ifcopenshell.entity_instance, keys: list[str]) -
|
||||
elif key == "container":
|
||||
value = ifcopenshell.util.element.get_container(value)
|
||||
elif key == "space":
|
||||
value = ifcopenshell.util.element.get_container(value, ifc_class="IfcSpace")
|
||||
value = ifcopenshell.util.element.get_parent(value, ifc_class="IfcSpace")
|
||||
elif key == "storey":
|
||||
value = ifcopenshell.util.element.get_container(value, ifc_class="IfcBuildingStorey")
|
||||
value = ifcopenshell.util.element.get_parent(value, ifc_class="IfcBuildingStorey")
|
||||
elif key == "building":
|
||||
value = ifcopenshell.util.element.get_container(value, ifc_class="IfcBuilding")
|
||||
value = ifcopenshell.util.element.get_parent(value, ifc_class="IfcBuilding")
|
||||
elif key == "site":
|
||||
value = ifcopenshell.util.element.get_container(value, ifc_class="IfcSite")
|
||||
value = ifcopenshell.util.element.get_parent(value, ifc_class="IfcSite")
|
||||
elif key == "parent":
|
||||
value = ifcopenshell.util.element.get_parent(value)
|
||||
elif key in ("types", "occurrences"):
|
||||
|
||||
Reference in New Issue
Block a user