diff --git a/src/bonsai/bonsai/bim/module/attribute/ui.py b/src/bonsai/bonsai/bim/module/attribute/ui.py index 84813e8d1e..934b053d2e 100644 --- a/src/bonsai/bonsai/bim/module/attribute/ui.py +++ b/src/bonsai/bonsai/bim/module/attribute/ui.py @@ -48,12 +48,14 @@ def draw_ui(context: bpy.types.Context, layout: bpy.types.UILayout, attributes) row = layout.row() op = row.operator("bim.enable_editing_attributes", icon="GREASEPENCIL", text="Edit") + element = tool.Ifc.get_entity(obj) + key_prefix = "type." if (element and element.is_a("IfcTypeObject")) else "" for attribute in attributes: row = layout.row(align=True) row.label(text=attribute["name"]) value = bonsai.bim.helper.get_display_value(attribute["value"]) op = row.operator("bim.select_similar", text=value, icon="NONE", emboss=False) - op.key = attribute["name"] + op.key = key_prefix + attribute["name"] # TODO: reimplement, see #1222 # if "IfcSite/" in context.active_object.name or "IfcBuilding/" in context.active_object.name: diff --git a/src/bonsai/bonsai/bim/module/type/ui.py b/src/bonsai/bonsai/bim/module/type/ui.py index fbd1edd446..1848858953 100644 --- a/src/bonsai/bonsai/bim/module/type/ui.py +++ b/src/bonsai/bonsai/bim/module/type/ui.py @@ -151,7 +151,8 @@ class BIM_PT_type_attributes(Panel): row = layout.row(align=True) row.label(text=attribute["name"]) value = get_display_value(attribute["value"]) - row.label(text=value) + op = row.operator("bim.select_similar", text=value, icon="NONE", emboss=False) + op.key = "type." + attribute["name"] def add_object_button(self, context):