mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 11:18:01 +00:00
Selects all the instances from selected instances that have different types
This commit is contained in:
@@ -166,15 +166,17 @@ class SelectSimilarType(bpy.types.Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
self.file = IfcStore.get_file()
|
self.file = IfcStore.get_file()
|
||||||
related_object = bpy.data.objects.get(self.related_object) if self.related_object else context.active_object
|
objects = bpy.context.selected_objects
|
||||||
relating_type = ifcopenshell.util.element.get_type(tool.Ifc.get_entity(related_object))
|
for related_object in objects:
|
||||||
if not relating_type:
|
relating_type = ifcopenshell.util.element.get_type(tool.Ifc.get_entity(related_object))
|
||||||
return {"FINISHED"}
|
if not relating_type:
|
||||||
related_objects = ifcopenshell.util.element.get_types(relating_type)
|
related_object.select_set(False)
|
||||||
for obj in context.visible_objects:
|
continue
|
||||||
element = tool.Ifc.get_entity(obj)
|
related_objects = ifcopenshell.util.element.get_types(relating_type)
|
||||||
if element and element in related_objects:
|
for obj in context.visible_objects:
|
||||||
obj.select_set(True)
|
element = tool.Ifc.get_entity(obj)
|
||||||
|
if element and element in related_objects:
|
||||||
|
obj.select_set(True)
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user