From d1fc5158dae3132592023126955ca9f0c2ab91af Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Wed, 13 Nov 2024 12:45:54 +0000 Subject: [PATCH] Change method of getting active drawing to use one in tool import as requested --- src/bonsai/bonsai/bim/module/drawing/operator.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/drawing/operator.py b/src/bonsai/bonsai/bim/module/drawing/operator.py index f1abdc8a8d..5166084653 100644 --- a/src/bonsai/bonsai/bim/module/drawing/operator.py +++ b/src/bonsai/bonsai/bim/module/drawing/operator.py @@ -162,7 +162,7 @@ class DuplicateDrawing(bpy.types.Operator, tool.Ifc.Operator): @classmethod def poll(cls, context): props = context.scene.DocProperties - active_drawing = props.drawings[props.active_drawing_index] + active_drawing = tool.Drawing.get_active_drawing_item() is_drawing_selected = active_drawing.ifc_definition_id > 0 if not is_drawing_selected: cls.poll_message_set("No drawing selected.") @@ -1472,7 +1472,7 @@ class DuplicateSheet(bpy.types.Operator, tool.Ifc.Operator): return False props = context.scene.DocProperties - active_drawing = props.drawings[props.active_drawing_index] + active_drawing = tool.Drawing.get_active_drawing_item() is_drawing_selected = active_drawing.ifc_definition_id > 0 if not is_drawing_selected: cls.poll_message_set("No drawing selected.") @@ -1874,7 +1874,7 @@ class OpenDrawing(bpy.types.Operator): @classmethod def poll(cls, context): props = context.scene.DocProperties - active_drawing = props.drawings[props.active_drawing_index] + active_drawing = tool.Drawing.get_active_drawing_item() is_drawing_selected = active_drawing.ifc_definition_id > 0 if not is_drawing_selected: cls.poll_message_set("No drawing selected.") @@ -2046,7 +2046,7 @@ class ActivateDrawing(bpy.types.Operator, ActivateDrawingBase): @classmethod def poll(cls, context): props = context.scene.DocProperties - active_drawing = props.drawings[props.active_drawing_index] + active_drawing = tool.Drawing.get_active_drawing_item() is_drawing_selected = active_drawing.ifc_definition_id > 0 if not is_drawing_selected: cls.poll_message_set("No drawing selected.") @@ -2121,7 +2121,7 @@ class RemoveDrawing(bpy.types.Operator, tool.Ifc.Operator): @classmethod def poll(cls, context): props = context.scene.DocProperties - active_drawing = props.drawings[props.active_drawing_index] + active_drawing = tool.Drawing.get_active_drawing_item() is_drawing_selected = active_drawing.ifc_definition_id > 0 if not is_drawing_selected: cls.poll_message_set("No drawing selected.") @@ -3372,7 +3372,7 @@ class ConvertSVGToDXF(bpy.types.Operator): @classmethod def poll(cls, context): props = context.scene.DocProperties - active_drawing = props.drawings[props.active_drawing_index] + active_drawing = tool.Drawing.get_active_drawing_item() is_drawing_selected = active_drawing.ifc_definition_id > 0 if not is_drawing_selected: cls.poll_message_set("No drawing selected.")