From 1892e9cc86957f324371455b4f150c1555adb98d Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sat, 20 Feb 2021 17:23:58 +1100 Subject: [PATCH] Fix bug where copying a class did not enforce mapped representations --- .../blenderbim/bim/module/root/operator.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ifcblenderexport/blenderbim/bim/module/root/operator.py b/src/ifcblenderexport/blenderbim/bim/module/root/operator.py index b84a8fc2e8..7212d8b00d 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/root/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/root/operator.py @@ -231,10 +231,11 @@ class CopyClass(bpy.types.Operator): self.file, {"product": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)} ).execute() IfcStore.link_element(result, obj) - if obj.data and obj.data.users == 1: - bpy.ops.bim.add_representation(obj=obj.name) - else: + relating_type = ifcopenshell.util.element.get_type(result) + if relating_type and relating_type.RepresentationMaps: bpy.ops.bim.map_representations( product_id=result.id(), type_product_id=ifcopenshell.util.element.get_type(result).id() ) + else: + bpy.ops.bim.add_representation(obj=obj.name) return {"FINISHED"}