From 20aa3ff94ee9942369efd1c0c4b358d1ff51ac36 Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Wed, 15 Apr 2026 16:58:01 -0500 Subject: [PATCH] Fix select_ifc_class clipboard query output Previously the clipboard was set inside the class loop, overwriting on each iteration and reporting multiple times. Now all classes are joined with " + " and the clipboard is set once after selection completes. Generated with the assistance of an AI coding tool. --- src/bonsai/bonsai/bim/module/search/operator.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/search/operator.py b/src/bonsai/bonsai/bim/module/search/operator.py index e6d3b08472..ff458bd5ac 100644 --- a/src/bonsai/bonsai/bim/module/search/operator.py +++ b/src/bonsai/bonsai/bim/module/search/operator.py @@ -1285,7 +1285,6 @@ class SelectIfcClass(Operator): if element := tool.Ifc.get_entity(obj): classes.add(element.is_a()) predefined_types.add(ifcopenshell.util.element.get_predefined_type(element)) - result = "" for cls in classes: for element in tool.Ifc.get().by_type(cls): if ( @@ -1299,13 +1298,10 @@ class SelectIfcClass(Operator): obj.hide_set(False) tool.Blender.select_object(obj) - # copy selection query to clipboard - if not result: - result = f"{cls}" - else: - result += f", {cls}" - bpy.context.window_manager.clipboard = result - self.report({"INFO"}, f"({result}) was copied to the clipboard.") + # copy selection query to clipboard + result = " + ".join(classes) + bpy.context.window_manager.clipboard = result + self.report({"INFO"}, f"({result}) was copied to the clipboard.") return {"FINISHED"}