Fix #4756. You can now use parent as a key in a selector key.

This commit is contained in:
Dion Moult
2024-06-01 17:30:21 +10:00
parent e26dae67aa
commit 00c13c5ea4
@@ -370,6 +370,8 @@ def set_element_value(
element = ifcopenshell.util.element.get_container(element, ifc_class="IfcBuilding")
elif key == "site":
element = ifcopenshell.util.element.get_container(element, ifc_class="IfcSite")
elif key == "parent":
element = ifcopenshell.util.element.get_parent(element)
elif key == "class":
if element.is_a().lower() != value.lower():
return ifcopenshell.util.schema.reassign_class(ifc_file, element, value)