mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
Fallback to the aggregate if default container is removed #6470
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user