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.
This commit is contained in:
Ryan Schultz
2026-04-15 16:58:01 -05:00
parent a2ec575618
commit 20aa3ff94e
@@ -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"}