From 7253b07b0cf749c6fb66bc0c1c82d681320eff69 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Thu, 21 Nov 2019 06:43:35 +1100 Subject: [PATCH] Fix broken select IFC type operator --- src/ifcblenderexport/blenderbim/operator.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ifcblenderexport/blenderbim/operator.py b/src/ifcblenderexport/blenderbim/operator.py index 616ed5e0ea..1aae920ace 100644 --- a/src/ifcblenderexport/blenderbim/operator.py +++ b/src/ifcblenderexport/blenderbim/operator.py @@ -133,13 +133,14 @@ class SelectType(bpy.types.Operator): def execute(self, context): for object in bpy.context.visible_objects: if '/' in object.name \ - and object.name[0:3] == 'Ifc' \ - and object.name.split('/')[0] == bpy.context.scene.BIMProperties.ifc_class \ - and 'IfcPredefinedType' in object.keys() \ - and object['IfcPredefinedType'] == bpy.context.scene.BIMProperties.ifc_predefined_type: + and object.name[0:3] == 'Ifc' \ + and object.name.split('/')[0] == bpy.context.scene.BIMProperties.ifc_class \ + and 'PredefinedType' in object.BIMObjectProperties.attributes \ + and object.BIMObjectProperties.attributes['PredefinedType'].string_value == bpy.context.scene.BIMProperties.ifc_predefined_type: if bpy.context.scene.BIMProperties.ifc_predefined_type != 'USERDEFINED': object.select_set(True) - elif object['IfcObjectType'] == bpy.context.scene.BIMProperties.ifc_userdefined_type: + elif 'ObjectType' in object.BIMObjectProperties.attributes \ + and object.BIMObjectProperties.attributes['ObjectType'].string_value == bpy.context.scene.BIMProperties.ifc_userdefined_type: object.select_set(True) return {'FINISHED'}