#1153 Symbol background option for text is now stored in a pset

This commit is contained in:
Dion Moult
2022-04-24 13:13:21 +10:00
parent f2c4b20187
commit cc8da4abf4
5 changed files with 18 additions and 17 deletions
@@ -5,7 +5,9 @@ FILE_NAME('EPset_Annotation.ifc','2020-01-01T00:00:00',(),(),'EPset_Annotation',
FILE_SCHEMA(('IFC4'));
ENDSEC;
DATA;
#1=IFCPROPERTYSETTEMPLATE('3VuPUwdCD2Qx3XDDRs0R1N',$,'EPset_Annotation','',.PSET_OCCURRENCEDRIVEN.,'IfcAnnotation',(#2));
#1=IFCPROPERTYSETTEMPLATE('3VuPUwdCD2Qx3XDDRs0R1N',$,'EPset_Annotation','',.PSET_OCCURRENCEDRIVEN.,'IfcAnnotation',(#2,#3));
#2=IFCSIMPLEPROPERTYTEMPLATE('2P7JN79n96Q9pElZ83LKe4',$,'ZIndex','',.P_SINGLEVALUE.,'IfcInteger',$,$,$,$,$,.READWRITE.);
#3=IFCSIMPLEPROPERTYTEMPLATE('2P7JN79n96Q9pElZ83LKe1',$,'Symbol','',.P_ENUMERATEDVALUE.,'IfcLabel',$,#4,$,$,$,.READWRITE.);
#4=IFCPROPERTYENUMERATION('Symbol',(IFCLABEL('rectangle-tag'), IFCLABEL('door-tag')),$);
ENDSEC;
END-ISO-10303-21;
@@ -401,13 +401,4 @@ class BIMTextProperties(PropertyGroup):
update=refreshFontSize,
name="Font Size",
)
symbol: EnumProperty(
items=[
("None", "None", ""),
("rectangle-tag", "Rectangle Tag", ""),
("door-tag", "Door Tag", ""),
],
update=refreshFontSize,
name="Symbol",
)
relating_product: PointerProperty(name="Relating Product", type=bpy.types.Object)
@@ -499,10 +499,9 @@ class SvgWriter:
(text_position * self.scale)[1],
)
if text_obj.BIMTextProperties.symbol != "None":
self.svg.add(
self.svg.use(f"#{text_obj.BIMTextProperties.symbol}", insert=tuple(text_position * self.scale))
)
symbol = tool.Drawing.get_annotation_symbol(element)
if symbol:
self.svg.add(self.svg.use(f"#{symbol}", insert=tuple(text_position * self.scale)))
if text_literal.BoxAlignment == "top-left":
alignment_baseline = "hanging"
@@ -814,6 +814,10 @@ class Drawing(blenderbim.core.tool.Drawing):
def get_annotation_z_index(cls, drawing):
return ifcopenshell.util.element.get_psets(drawing).get("EPset_Annotation", {}).get("ZIndex", 0)
@classmethod
def get_annotation_symbol(cls, drawing):
return ifcopenshell.util.element.get_psets(drawing).get("EPset_Annotation", {}).get("Symbol", None)
@classmethod
def has_linework(cls, drawing):
return ifcopenshell.util.element.get_psets(drawing)["EPset_Drawing"].get("HasLinework", False)
@@ -665,13 +665,18 @@ class Usecase:
)
def create_annotation3d_representation(self):
geometry = self.create_curves(should_exclude_faces=True, is_2d=False)
geometry.extend(self.create_curve_bounded_planes())
items = []
curves = self.create_curves(should_exclude_faces=True, is_2d=False)
if curves:
items.append(self.file.createIfcGeometricCurveSet(curves))
surfaces = self.create_curve_bounded_planes()
if surfaces:
items.append(self.file.createIfcGeometricSet(surfaces))
return self.file.createIfcShapeRepresentation(
self.settings["context"],
self.settings["context"].ContextIdentifier,
"GeometricSet",
[self.file.createIfcGeometricSet(geometry)],
items,
)
def create_geometric_curve_set_representation(self, is_2d=False):