mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
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:
@@ -28,7 +28,6 @@ classes = (
|
|||||||
operator.AddAnnotationType,
|
operator.AddAnnotationType,
|
||||||
operator.AddDrawing,
|
operator.AddDrawing,
|
||||||
operator.AddDrawingStyle,
|
operator.AddDrawingStyle,
|
||||||
operator.AddDrawingStyleAttribute,
|
|
||||||
operator.AddDrawingToSheet,
|
operator.AddDrawingToSheet,
|
||||||
operator.AddReference,
|
operator.AddReference,
|
||||||
operator.AddReferenceImage,
|
operator.AddReferenceImage,
|
||||||
@@ -80,7 +79,6 @@ classes = (
|
|||||||
operator.RemoveDrawing,
|
operator.RemoveDrawing,
|
||||||
operator.RemoveDrawingFromSheet,
|
operator.RemoveDrawingFromSheet,
|
||||||
operator.RemoveDrawingStyle,
|
operator.RemoveDrawingStyle,
|
||||||
operator.RemoveDrawingStyleAttribute,
|
|
||||||
operator.RemoveReference,
|
operator.RemoveReference,
|
||||||
operator.RemoveSchedule,
|
operator.RemoveSchedule,
|
||||||
operator.RemoveSheet,
|
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))
|
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):
|
class CleanWireframes(bpy.types.Operator):
|
||||||
bl_idname = "bim.clean_wireframes"
|
bl_idname = "bim.clean_wireframes"
|
||||||
bl_label = "Clean Wireframes"
|
bl_label = "Clean Wireframes"
|
||||||
|
|||||||
@@ -221,14 +221,6 @@ class BIM_PT_drawing_underlay(Panel):
|
|||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.prop(drawing_style, "exclude_query")
|
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 = layout.row(align=True)
|
||||||
row.operator("bim.save_drawing_style")
|
row.operator("bim.save_drawing_style")
|
||||||
row.operator("bim.activate_drawing_style")
|
row.operator("bim.activate_drawing_style")
|
||||||
|
|||||||
@@ -1846,15 +1846,9 @@ class Drawing(bonsai.core.tool.Drawing):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_drawing_metadata(cls, drawing: ifcopenshell.entity_instance) -> list[str]:
|
def get_drawing_metadata(cls, drawing: ifcopenshell.entity_instance) -> list[str]:
|
||||||
# fmt: off
|
pset_data = ifcopenshell.util.element.get_pset(drawing, "EPset_Drawing")
|
||||||
return [
|
metadata_str = pset_data.get("Metadata", "") or ""
|
||||||
v.strip()
|
return [v_ for v in metadata_str.split(",") if (v_ := v.strip())]
|
||||||
for v in (
|
|
||||||
ifcopenshell.util.element.get_psets(drawing)["EPset_Drawing"].get("Metadata", "") or ""
|
|
||||||
).split(",")
|
|
||||||
if v
|
|
||||||
]
|
|
||||||
# fmt: on
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_annotation_z_index(cls, drawing: ifcopenshell.entity_instance) -> float:
|
def get_annotation_z_index(cls, drawing: ifcopenshell.entity_instance) -> float:
|
||||||
|
|||||||
Reference in New Issue
Block a user