diff --git a/src/blenderbim/blenderbim/bim/handler.py b/src/blenderbim/blenderbim/bim/handler.py index 0cdd9ea2b6..2626d5335d 100644 --- a/src/blenderbim/blenderbim/bim/handler.py +++ b/src/blenderbim/blenderbim/bim/handler.py @@ -9,17 +9,18 @@ from ifcopenshell.api.attribute.data import Data as AttributeData def mode_callback(obj, data): - if ( - obj.mode != "OBJECT" - or not obj.data - or not isinstance(obj.data, bpy.types.Mesh) - or not obj.data.BIMMeshProperties.ifc_definition_id - or not bpy.context.scene.BIMProjectProperties.is_authoring - ): - return - representation = IfcStore.get_file().by_id(obj.data.BIMMeshProperties.ifc_definition_id) - if representation.RepresentationType == "Tessellation" or representation.RepresentationType == "Brep": - IfcStore.edited_objs.add(obj.name) + for obj in bpy.context.selected_objects: + if ( + obj.mode != "OBJECT" + or not obj.data + or not isinstance(obj.data, bpy.types.Mesh) + or not obj.data.BIMMeshProperties.ifc_definition_id + or not bpy.context.scene.BIMProjectProperties.is_authoring + ): + return + representation = IfcStore.get_file().by_id(obj.data.BIMMeshProperties.ifc_definition_id) + if representation.RepresentationType == "Tessellation" or representation.RepresentationType == "Brep": + IfcStore.edited_objs.add(obj.name) def name_callback(obj, data):