Placeholder operator for DuplicateSheet function.

Does nothing but report Not Implemented. Could be omitted if this
kind of thing is frowned upon.
This commit is contained in:
Stephen Boddy
2024-11-02 00:05:31 +00:00
parent 1140e0e919
commit 5bffa98eee
2 changed files with 39 additions and 0 deletions
@@ -53,6 +53,7 @@ classes = (
operator.DisableEditingSheets,
operator.DisableEditingText,
operator.DuplicateDrawing,
operator.DuplicateSheet,
operator.EditAssignedProduct,
operator.EditElementFilter,
operator.EditSheet,
@@ -1446,6 +1446,44 @@ class AddSheet(bpy.types.Operator, tool.Ifc.Operator):
core.add_sheet(tool.Ifc, tool.Drawing, titleblock=context.scene.DocProperties.titleblock)
class DuplicateSheet(bpy.types.Operator, tool.Ifc.Operator):
bl_idname = "bim.duplicate_sheet"
bl_label = "Duplicate Sheet"
bl_description = "Make a copy of currently selected sheet"
bl_options = {"REGISTER", "UNDO"}
drawing: bpy.props.IntProperty()
@classmethod
def poll(cls, context):
# Unconditionally disable until implemented
cls.poll_message_set("Not implemented yet.")
return False
props = context.scene.DocProperties
active_drawing = props.drawings[props.active_drawing_index]
is_drawing_selected = active_drawing.ifc_definition_id > 0
if not is_drawing_selected:
cls.poll_message_set("No drawing selected.")
return False
return True
def _execute(self, context):
pass
'''
self.props = context.scene.DocProperties
core.duplicate_sheet(
tool.Ifc,
tool.Drawing,
sheet=tool.Ifc.get().by_id(self.sheet),
)
try:
sheet = tool.Ifc.get().by_id(self.props.active_sheet_id)
core.sync_references(tool.Ifc, tool.Collector, tool.Sheet, drawing=sheet)
except:
pass
'''
class OpenLayout(bpy.types.Operator, tool.Ifc.Operator):
bl_idname = "bim.open_layout"
bl_label = "Open Sheet Layout"