From 5678fe4888e974b05758f3a66a42f69d45628015 Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Sun, 19 Jul 2026 14:00:44 -0500 Subject: [PATCH] Fix #6652: Extend grab selection to include BBIM_Array members (#7968) When grabbing an array child, the selection now expands to include the array parent and all sibling children before the move operator runs. Mirrors existing behavior for aggregates and nests. Generated with the assistance of an AI coding tool. (cherry picked from commit b66d8b2c4dfc7e65116b226ded82705ca74878d1) --- .../bonsai/bim/module/geometry/operator.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/bonsai/bonsai/bim/module/geometry/operator.py b/src/bonsai/bonsai/bim/module/geometry/operator.py index 3c32f01618..7c49a0d076 100644 --- a/src/bonsai/bonsai/bim/module/geometry/operator.py +++ b/src/bonsai/bonsai/bim/module/geometry/operator.py @@ -4116,6 +4116,31 @@ class OverrideMoveSelect(bpy.types.Operator): self.new_active_obj = obj return {"FINISHED"} + # Get arrays + ifc_file = tool.Ifc.get() + array_parents_to_move: list[bpy.types.Object] = [] + for obj in list(context.selected_objects): + element = tool.Ifc.get_entity(obj) + if not element: + continue + pset = ifcopenshell.util.element.get_pset(element, "BBIM_Array") + if not pset: + continue + parent_element = ifc_file.by_guid(pset["Parent"]) + parent_obj = tool.Ifc.get_object(parent_element) + if parent_obj not in array_parents_to_move: + array_parents_to_move.append(parent_obj) + if element.GlobalId != pset["Parent"]: + obj.select_set(False) + + if array_parents_to_move: + for parent_obj in array_parents_to_move: + parent_element = tool.Ifc.get_entity(parent_obj) + for array_obj in tool.Array.get_all_objects(parent_element): + array_obj.select_set(True) + self.new_active_obj = parent_obj + return {"FINISHED"} + # Get nests props = tool.Nest.get_nest_props() not_editing_objs = [o.obj for o in props.not_editing_objects]