mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-19 19:54:07 +00:00
Fix assign_container in spatial.py (#8079)
ifc.get_object(element) can return None for IFC elements that aren't loaded as Blender objects (e.g., decomposed sub-elements). The loop now skips those instead of passing None into collector.assign(). Cheers!
This commit is contained in:
@@ -67,7 +67,8 @@ def assign_container(
|
|||||||
if products := [e for e in root_elements if spatial.can_contain(container, root_element)]:
|
if products := [e for e in root_elements if spatial.can_contain(container, root_element)]:
|
||||||
ifc.run("spatial.assign_container", products=products, relating_structure=container)
|
ifc.run("spatial.assign_container", products=products, relating_structure=container)
|
||||||
for element in all_elements:
|
for element in all_elements:
|
||||||
collector.assign(ifc.get_object(element))
|
if obj := ifc.get_object(element):
|
||||||
|
collector.assign(obj)
|
||||||
|
|
||||||
|
|
||||||
def enable_editing_container(spatial: type[tool.Spatial], obj: bpy.types.Object) -> None:
|
def enable_editing_container(spatial: type[tool.Spatial], obj: bpy.types.Object) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user