Minor fix

This commit is contained in:
Dion Moult
2023-03-20 17:03:39 +11:00
parent c97e1079e8
commit 72b5cc8a44
4 changed files with 18 additions and 9 deletions
@@ -65,8 +65,7 @@ class TextData:
element = tool.Ifc.get_entity(bpy.context.active_object)
if not element or not element.is_a("IfcAnnotation") or element.ObjectType not in ["TEXT", "TEXT_LEADER"]:
return []
rep = ifcopenshell.util.representation.get_representation(element, "Plan", "Annotation")
text_literal = [i for i in rep.Items if i.is_a("IfcTextLiteral")][0]
text_literal = tool.Drawing.get_text_literal(bpy.context.active_object)
return [
{"name": "Literal", "value": text_literal.Literal},
{"name": "BoxAlignment", "value": text_literal.BoxAlignment},
@@ -616,8 +616,7 @@ class SvgWriter:
x_offset = self.raw_width / 2
y_offset = self.raw_height / 2
element = tool.Ifc.get_entity(text_obj)
rep = ifcopenshell.util.representation.get_representation(element, "Plan", "Annotation")
text_literal = [i for i in rep.Items if i.is_a("IfcTextLiteral")][0]
text_literal = tool.Drawing.get_text_literal(text_obj)
text_position = self.project_point_onto_camera(position)
text_position = Vector(((x_offset + text_position.x), (y_offset - text_position.y)))
+3 -1
View File
@@ -304,7 +304,9 @@ class Drawing(blenderbim.core.tool.Drawing):
element = tool.Ifc.get_entity(obj)
if not element:
return
rep = ifcopenshell.util.representation.get_representation(element, "Plan", "Annotation")
rep = ifcopenshell.util.representation.get_representation(
element, "Plan", "Annotation"
) or ifcopenshell.util.representation.get_representation(element, "Model", "Annotation")
if not rep:
return
items = [i for i in rep.Items if i.is_a("IfcTextLiteral")]