mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 10:43:46 +00:00
common method for getting annotation symbol
This commit is contained in:
@@ -320,7 +320,7 @@ class DecoratorData:
|
|||||||
font_size = FONT_SIZES[font_size_type]
|
font_size = FONT_SIZES[font_size_type]
|
||||||
|
|
||||||
# get symbol
|
# get symbol
|
||||||
symbol = pset_data.get("Symbol", None)
|
symbol = tool.Drawing.get_annotation_symbol(element)
|
||||||
|
|
||||||
# other attributes
|
# other attributes
|
||||||
props_literals = props.literals
|
props_literals = props.literals
|
||||||
|
|||||||
@@ -864,10 +864,7 @@ class SvgWriter:
|
|||||||
point = self.project_point_onto_camera(obj.matrix_world.translation)
|
point = self.project_point_onto_camera(obj.matrix_world.translation)
|
||||||
|
|
||||||
element = tool.Ifc.get_entity(obj)
|
element = tool.Ifc.get_entity(obj)
|
||||||
svg_id = ifcopenshell.util.element.get_pset(element, "EPset_Annotation", "Symbol")
|
svg_id = tool.Drawing.get_annotation_symbol(element)
|
||||||
if not svg_id:
|
|
||||||
# EPset_AnnotationSurveyArea is not standard! See bSI-4.3 proposal #660.
|
|
||||||
svg_id = ifcopenshell.util.element.get_pset(element, "EPset_AnnotationSurveyArea", "PointType")
|
|
||||||
if not svg_id:
|
if not svg_id:
|
||||||
svg_id = str(ifcopenshell.util.element.get_predefined_type(element))
|
svg_id = str(ifcopenshell.util.element.get_predefined_type(element))
|
||||||
if not svg_id:
|
if not svg_id:
|
||||||
@@ -913,10 +910,7 @@ class SvgWriter:
|
|||||||
projected_points = [self.project_point_onto_camera(matrix_world @ v.co) for v in obj.data.vertices]
|
projected_points = [self.project_point_onto_camera(matrix_world @ v.co) for v in obj.data.vertices]
|
||||||
|
|
||||||
element = tool.Ifc.get_entity(obj)
|
element = tool.Ifc.get_entity(obj)
|
||||||
svg_id = ifcopenshell.util.element.get_pset(element, "EPset_Annotation", "Symbol")
|
svg_id = tool.Drawing.get_annotation_symbol(element)
|
||||||
if not svg_id:
|
|
||||||
# EPset_AnnotationSurveyArea is not standard! See bSI-4.3 proposal #660.
|
|
||||||
svg_id = ifcopenshell.util.element.get_pset(element, "EPset_AnnotationSurveyArea", "PointType")
|
|
||||||
if not svg_id:
|
if not svg_id:
|
||||||
svg_id = str(ifcopenshell.util.element.get_predefined_type(element))
|
svg_id = str(ifcopenshell.util.element.get_predefined_type(element))
|
||||||
if not svg_id:
|
if not svg_id:
|
||||||
|
|||||||
@@ -1520,8 +1520,12 @@ class Drawing(blenderbim.core.tool.Drawing):
|
|||||||
return ifcopenshell.util.element.get_pset(drawing, "EPset_Annotation", "ZIndex") or 0
|
return ifcopenshell.util.element.get_pset(drawing, "EPset_Annotation", "ZIndex") or 0
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_annotation_symbol(cls, drawing: ifcopenshell.entity_instance) -> Union[str, None]:
|
def get_annotation_symbol(cls, element: ifcopenshell.entity_instance) -> Union[str, None]:
|
||||||
return ifcopenshell.util.element.get_pset(drawing, "EPset_Annotation", "Symbol")
|
symbol = ifcopenshell.util.element.get_pset(element, "EPset_Annotation", "Symbol")
|
||||||
|
if not symbol:
|
||||||
|
# EPset_AnnotationSurveyArea is not standard! See bSI-4.3 proposal #660.
|
||||||
|
symbol = ifcopenshell.util.element.get_pset(element, "EPset_AnnotationSurveyArea", "PointType")
|
||||||
|
return symbol
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def has_linework(cls, drawing):
|
def has_linework(cls, drawing):
|
||||||
|
|||||||
Reference in New Issue
Block a user