Remove drawing styles attributes

It's been awhile since they were unused (2c301d7) and now they're replaced with EPset_Drawing.Metadata
This commit is contained in:
Andrej730
2025-05-14 12:48:13 +05:00
parent 6251750133
commit a50c633cf4
4 changed files with 3 additions and 48 deletions
@@ -28,7 +28,6 @@ classes = (
operator.AddAnnotationType,
operator.AddDrawing,
operator.AddDrawingStyle,
operator.AddDrawingStyleAttribute,
operator.AddDrawingToSheet,
operator.AddReference,
operator.AddReferenceImage,
@@ -80,7 +79,6 @@ classes = (
operator.RemoveDrawing,
operator.RemoveDrawingFromSheet,
operator.RemoveDrawingStyle,
operator.RemoveDrawingStyleAttribute,
operator.RemoveReference,
operator.RemoveSchedule,
operator.RemoveSheet,
@@ -2893,35 +2893,6 @@ class OpenReference(bpy.types.Operator, tool.Ifc.Operator):
core.open_reference(tool.Drawing, reference=tool.Ifc.get().by_id(self.reference))
# TODO: dead code - drawing style attributes are never used?
class AddDrawingStyleAttribute(bpy.types.Operator):
bl_idname = "bim.add_drawing_style_attribute"
bl_label = "Add Drawing Style Attribute"
bl_options = {"REGISTER", "UNDO"}
def execute(self, context):
assert context.scene and (camera := context.scene.camera)
props = tool.Drawing.get_camera_props(camera)
assert (drawing_style := props.get_active_drawing_style())
drawing_style.attributes.add()
return {"FINISHED"}
# TODO: dead code - drawing style attributes are never used?
class RemoveDrawingStyleAttribute(bpy.types.Operator):
bl_idname = "bim.remove_drawing_style_attribute"
bl_label = "Remove Drawing Style Attribute"
bl_options = {"REGISTER", "UNDO"}
index: bpy.props.IntProperty()
def execute(self, context):
assert context.scene and (camera := context.scene.camera)
props = tool.Drawing.get_camera_props(camera)
assert (drawing_style := props.get_active_drawing_style())
drawing_style.attributes.remove(self.index)
return {"FINISHED"}
class CleanWireframes(bpy.types.Operator):
bl_idname = "bim.clean_wireframes"
bl_label = "Clean Wireframes"
@@ -221,14 +221,6 @@ class BIM_PT_drawing_underlay(Panel):
row = layout.row(align=True)
row.prop(drawing_style, "exclude_query")
row = layout.row()
row.operator("bim.add_drawing_style_attribute")
for index, attribute in enumerate(drawing_style.attributes):
row = layout.row(align=True)
row.prop(attribute, "name", text="")
row.operator("bim.remove_drawing_style_attribute", icon="X", text="").index = index
row = layout.row(align=True)
row.operator("bim.save_drawing_style")
row.operator("bim.activate_drawing_style")
+3 -9
View File
@@ -1846,15 +1846,9 @@ class Drawing(bonsai.core.tool.Drawing):
@classmethod
def get_drawing_metadata(cls, drawing: ifcopenshell.entity_instance) -> list[str]:
# fmt: off
return [
v.strip()
for v in (
ifcopenshell.util.element.get_psets(drawing)["EPset_Drawing"].get("Metadata", "") or ""
).split(",")
if v
]
# fmt: on
pset_data = ifcopenshell.util.element.get_pset(drawing, "EPset_Drawing")
metadata_str = pset_data.get("Metadata", "") or ""
return [v_ for v in metadata_str.split(",") if (v_ := v.strip())]
@classmethod
def get_annotation_z_index(cls, drawing: ifcopenshell.entity_instance) -> float: