mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 02:31:09 +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
|
collection = tool.Blender.get_object_bim_props(obj).collection
|
||||||
if collection:
|
if collection:
|
||||||
parent = ifcopenshell.util.element.get_aggregate(element)
|
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:
|
if not parent:
|
||||||
parent = ifcopenshell.util.element.get_container(element)
|
parent = ifcopenshell.util.element.get_container(element)
|
||||||
if parent:
|
if parent:
|
||||||
|
|||||||
Reference in New Issue
Block a user