mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 23:36:20 +00:00
Can bim.select_similar from the pset or attribute panels
This commit is contained in:
@@ -46,7 +46,10 @@ def draw_ui(context, layout, obj_type, attributes):
|
|||||||
for attribute in attributes:
|
for attribute in attributes:
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.label(text=attribute["name"])
|
row.label(text=attribute["name"])
|
||||||
row.label(text=attribute["value"])
|
# row.label(text=attribute["value"])
|
||||||
|
op = row.operator("bim.select_similar", text=attribute["value"], icon="NONE", emboss=False)
|
||||||
|
op.key = attribute['name']
|
||||||
|
|
||||||
|
|
||||||
# TODO: reimplement, see #1222
|
# TODO: reimplement, see #1222
|
||||||
# if "IfcSite/" in context.active_object.name or "IfcBuilding/" in context.active_object.name:
|
# if "IfcSite/" in context.active_object.name or "IfcBuilding/" in context.active_object.name:
|
||||||
|
|||||||
@@ -143,7 +143,9 @@ def draw_psetqto_ui(context, pset_id, pset, props, layout, obj_type, allow_remov
|
|||||||
row = box.row(align=True)
|
row = box.row(align=True)
|
||||||
row.scale_y = 0.8
|
row.scale_y = 0.8
|
||||||
row.label(text=prop["Name"])
|
row.label(text=prop["Name"])
|
||||||
row.label(text=str(prop["NominalValue"]))
|
op = row.operator("bim.select_similar", text=str(prop["NominalValue"]), icon="NONE", emboss=False)
|
||||||
|
op.key = pset['Name']
|
||||||
|
|
||||||
if not has_props_displayed:
|
if not has_props_displayed:
|
||||||
row = box.row()
|
row = box.row()
|
||||||
row.scale_y = 0.8
|
row.scale_y = 0.8
|
||||||
|
|||||||
@@ -633,12 +633,14 @@ class SelectSimilar(Operator, tool.Ifc.Operator):
|
|||||||
bl_label = "Select Similar"
|
bl_label = "Select Similar"
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
|
|
||||||
|
key: bpy.props.StringProperty()
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
props = context.scene.BIMSearchProperties
|
props = context.scene.BIMSearchProperties
|
||||||
obj = context.active_object
|
obj = context.active_object
|
||||||
element = tool.Ifc.get_entity(obj)
|
element = tool.Ifc.get_entity(obj)
|
||||||
key = props.element_key
|
key = self.key
|
||||||
if props.element_key == "PredefinedType":
|
if key == "PredefinedType":
|
||||||
key = "predefined_type"
|
key = "predefined_type"
|
||||||
value = ifcopenshell.util.selector.get_element_value(element, key)
|
value = ifcopenshell.util.selector.get_element_value(element, key)
|
||||||
for obj in context.visible_objects:
|
for obj in context.visible_objects:
|
||||||
|
|||||||
@@ -113,7 +113,8 @@ class BIM_PT_select_similar(Panel):
|
|||||||
if SelectSimilarData.data["element_key"]:
|
if SelectSimilarData.data["element_key"]:
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.prop(props, "element_key", text="")
|
row.prop(props, "element_key", text="")
|
||||||
row.operator("bim.select_similar", text="", icon="RESTRICT_SELECT_OFF")
|
op = row.operator("bim.select_similar", text="", icon="RESTRICT_SELECT_OFF")
|
||||||
|
op.key = props.element_key
|
||||||
else:
|
else:
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
row.label(text=f"No Active Element")
|
row.label(text=f"No Active Element")
|
||||||
|
|||||||
Reference in New Issue
Block a user