From d501970352326d421b5f48752dbdf65db4d77d26 Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Sat, 30 May 2026 17:41:50 -0500 Subject: [PATCH] Add clipboard copy to SelectSimilarContainer operator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After selecting objects in the same container, copy a `location="Name"` filter query to the clipboard and report it — consistent with the same behaviour in SelectSimilarType, SelectSimilarAggregate, SelectIfcClass, and SelectSimilarMaterial. Generated with the assistance of an AI coding tool. --- src/bonsai/bonsai/bim/module/spatial/operator.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/bonsai/bonsai/bim/module/spatial/operator.py b/src/bonsai/bonsai/bim/module/spatial/operator.py index cd6bc6cab2..7279b3b6c4 100644 --- a/src/bonsai/bonsai/bim/module/spatial/operator.py +++ b/src/bonsai/bonsai/bim/module/spatial/operator.py @@ -302,6 +302,15 @@ class SelectSimilarContainer(bpy.types.Operator): is_recursive=self.is_recursive, ) self.is_recursive = True # <-- forcibly reset + + element = tool.Ifc.get_entity(context.active_object) + if element: + container = tool.Spatial.get_container(element) + if container: + result = f'location="{container.Name}"' + bpy.context.window_manager.clipboard = result + self.report({"INFO"}, f"({result}) was copied to the clipboard.") + return {"FINISHED"}