mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 13:38:05 +00:00
Fix bpy.ops.bim.select_by_material() for layersets
This operator assumes all material definitions have a Name attribute, mostly they do except that Material Layer Sets have a LayerSetName attribute for reasons.
This commit is contained in:
@@ -67,7 +67,10 @@ class SelectByMaterial(bpy.types.Operator):
|
|||||||
core.select_by_material(tool.Material, tool.Spatial, material=material)
|
core.select_by_material(tool.Material, tool.Spatial, material=material)
|
||||||
|
|
||||||
# copy selection query to clipboard
|
# copy selection query to clipboard
|
||||||
material_name = material.Name
|
if material.is_a("IfcMaterialLayerSet"):
|
||||||
|
material_name = material.LayerSetName
|
||||||
|
else:
|
||||||
|
material_name = material.Name
|
||||||
result = f'material="{material_name}"'
|
result = f'material="{material_name}"'
|
||||||
bpy.context.window_manager.clipboard = result
|
bpy.context.window_manager.clipboard = result
|
||||||
self.report({"INFO"}, f"({result}) was copied to the clipboard.")
|
self.report({"INFO"}, f"({result}) was copied to the clipboard.")
|
||||||
|
|||||||
Reference in New Issue
Block a user