mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 06:39:13 +00:00
Add clipboard copy to SelectSimilarContainer operator
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.
This commit is contained in:
@@ -302,6 +302,15 @@ class SelectSimilarContainer(bpy.types.Operator):
|
|||||||
is_recursive=self.is_recursive,
|
is_recursive=self.is_recursive,
|
||||||
)
|
)
|
||||||
self.is_recursive = True # <-- forcibly reset
|
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"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user