Closes #6748: An option, when running bim.select_similar_container() to only select those objects in the immediate container

This commit is contained in:
Ryan Schultz
2025-06-28 13:16:51 -05:00
parent 524561a398
commit 553003e664
3 changed files with 24 additions and 5 deletions
+7 -2
View File
@@ -110,10 +110,15 @@ def select_container(
spatial.set_active_object(ifc.get_object(container), selection_mode=selection_mode)
def select_similar_container(ifc: type[tool.Ifc], spatial: type[tool.Spatial], obj: bpy.types.Object) -> None:
def select_similar_container(
ifc: type[tool.Ifc],
spatial: type[tool.Spatial],
obj: bpy.types.Object,
is_recursive: bool = True,
) -> None:
element = ifc.get_entity(obj)
if element:
spatial.select_products(spatial.get_decomposed_elements(spatial.get_container(element)))
spatial.select_products(spatial.get_decomposed_elements(spatial.get_container(element), is_recursive))
def select_product(spatial: type[tool.Spatial], product: ifcopenshell.entity_instance) -> None: