Fallback to the aggregate if default container is removed #6470

This commit is contained in:
Andrej730
2025-03-31 13:47:54 +05:00
parent 4593e5aea6
commit 8d530eba68
+5
View File
@@ -248,6 +248,11 @@ class Geometry(bonsai.core.tool.Geometry):
collection = tool.Blender.get_object_bim_props(obj).collection
if collection:
parent = ifcopenshell.util.element.get_aggregate(element)
# Fallback to the aggregate as a new default container instead of resetting it.
if tool.Root.get_default_container() == element and parent and not parent.is_a("IfcProject"):
tool.Spatial.set_default_container(parent)
if not parent:
parent = ifcopenshell.util.element.get_container(element)
if parent: