From 117f663f486427ab0ab634fe4909cfdbc39621f7 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sat, 6 Nov 2021 17:48:31 +1100 Subject: [PATCH] Fix bug where you couldn't add a plan representation to something with no context identifier --- .../ifcopenshell/api/geometry/add_representation.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ifcopenshell-python/ifcopenshell/api/geometry/add_representation.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/add_representation.py index 295ae8f6c1..906a06e610 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/geometry/add_representation.py +++ b/src/ifcopenshell-python/ifcopenshell/api/geometry/add_representation.py @@ -142,6 +142,12 @@ class Usecase: pass elif self.settings["context"].ContextIdentifier == "SurveyPoints": pass + else: + if isinstance(self.settings["geometry"], bpy.types.TextCurve): + return self.create_text_representation() + shape_representation = self.create_geometric_curve_set_representation(is_2d=True) + shape_representation.RepresentationType = "Annotation2D" + return shape_representation def create_lighting_representation(self): return self.file.createIfcShapeRepresentation(