mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 23:36:20 +00:00
Minor fix to "select multiple IFC class" implementation
This commit is contained in:
@@ -62,8 +62,7 @@ class BIM_PT_class(Panel):
|
|||||||
else:
|
else:
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.label(text=IfcClassData.data["name"])
|
row.label(text=IfcClassData.data["name"])
|
||||||
op = row.operator("bim.select_ifc_class", text="", icon="RESTRICT_SELECT_OFF")
|
row.operator("bim.select_ifc_class", text="", icon="RESTRICT_SELECT_OFF")
|
||||||
op.ifc_class = IfcClassData.data["ifc_class"]
|
|
||||||
row.operator("bim.unlink_object", icon="UNLINKED", text="")
|
row.operator("bim.unlink_object", icon="UNLINKED", text="")
|
||||||
if IfcClassData.data["can_reassign_class"]:
|
if IfcClassData.data["can_reassign_class"]:
|
||||||
row.operator("bim.enable_reassign_class", icon="GREASEPENCIL", text="")
|
row.operator("bim.enable_reassign_class", icon="GREASEPENCIL", text="")
|
||||||
|
|||||||
@@ -431,15 +431,17 @@ class SelectIfcClass(Operator):
|
|||||||
bl_idname = "bim.select_ifc_class"
|
bl_idname = "bim.select_ifc_class"
|
||||||
bl_label = "Select IFC Class"
|
bl_label = "Select IFC Class"
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
ifc_class: StringProperty()
|
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
objects = bpy.context.selected_objects
|
objects = bpy.context.selected_objects
|
||||||
for object in objects:
|
classes = set()
|
||||||
element = tool.Ifc.get_entity(object)
|
for obj in objects:
|
||||||
element_class = element.is_a()
|
element = tool.Ifc.get_entity(obj)
|
||||||
for elem in tool.Ifc.get().by_type(element_class):
|
if element:
|
||||||
obj = tool.Ifc.get_object(elem)
|
classes.add(element.is_a())
|
||||||
|
for cls in classes:
|
||||||
|
for element in tool.Ifc.get().by_type(cls):
|
||||||
|
obj = tool.Ifc.get_object(element)
|
||||||
if obj:
|
if obj:
|
||||||
obj.select_set(True)
|
obj.select_set(True)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|||||||
Reference in New Issue
Block a user