From 7720166c3101be0a5f8d28fb43e4abbf62a4fb73 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Thu, 13 Jul 2023 22:22:00 +1000 Subject: [PATCH] Fix #3393. Bug where duplicating a typed text didn't also copy its literal. --- src/blenderbim/blenderbim/tool/root.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/blenderbim/blenderbim/tool/root.py b/src/blenderbim/blenderbim/tool/root.py index fb7eaa4e51..eee7eb53c5 100644 --- a/src/blenderbim/blenderbim/tool/root.py +++ b/src/blenderbim/blenderbim/tool/root.py @@ -111,8 +111,12 @@ class Root(blenderbim.core.tool.Root): if obj.data and obj.data.BIMMeshProperties.ifc_definition_id: return tool.Ifc.get().by_id(obj.data.BIMMeshProperties.ifc_definition_id) element = tool.Ifc.get_entity(obj) - if not obj.data and getattr(element, "ObjectType", None) == "TEXT": - return element.Representation.Representations[0] + if element.is_a("IfcTypeProduct"): + if element.RepresentationMaps: + return element.RepresentationMaps[0].MappedRepresentation + elif element.is_a("IfcProduct"): + if element.Representation: + return element.Representation.Representations[0] @classmethod def get_representation_context(cls, representation):