mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 13:46:54 +00:00
Optimise select audited operator
This commit is contained in:
@@ -225,13 +225,15 @@ class SelectAudited(bpy.types.Operator):
|
|||||||
bl_label = 'Select Audited'
|
bl_label = 'Select Audited'
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
audited_global_ids = []
|
||||||
with open(bpy.context.scene.BIMProperties.data_dir + 'audit.txt') as file:
|
with open(bpy.context.scene.BIMProperties.data_dir + 'audit.txt') as file:
|
||||||
for line in file:
|
for line in file:
|
||||||
for object in bpy.context.visible_objects:
|
audited_global_ids.append(line.split(' ')[3])
|
||||||
index = object.BIMObjectProperties.attributes.find('GlobalId')
|
for object in bpy.context.visible_objects:
|
||||||
if index != -1 \
|
index = object.BIMObjectProperties.attributes.find('GlobalId')
|
||||||
and object.BIMObjectProperties.attributes[index].string_value == line.split(' ')[3]:
|
if index != -1 \
|
||||||
object.select_set(True)
|
and object.BIMObjectProperties.attributes[index].string_value in audited_global_ids:
|
||||||
|
object.select_set(True)
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
class QuickProjectSetup(bpy.types.Operator):
|
class QuickProjectSetup(bpy.types.Operator):
|
||||||
|
|||||||
Reference in New Issue
Block a user