From c11ba23a3d0bd7794ca1f3612f95c8e23a52877f Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Sat, 3 Aug 2024 11:01:31 -0500 Subject: [PATCH] Fix #3728 - Be able to `bim.activate_drawing` a drawing listed in the sheets UI, as well. --- src/blenderbim/blenderbim/bim/module/drawing/ui.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/blenderbim/blenderbim/bim/module/drawing/ui.py b/src/blenderbim/blenderbim/bim/module/drawing/ui.py index 2118641839..7574fbe40f 100644 --- a/src/blenderbim/blenderbim/bim/module/drawing/ui.py +++ b/src/blenderbim/blenderbim/bim/module/drawing/ui.py @@ -430,6 +430,19 @@ class BIM_PT_sheets(Panel): active_sheet = self.props.sheets[self.props.active_sheet_index] row = self.layout.row(align=True) row.alignment = "RIGHT" + + if active_sheet.reference_type == "DRAWING": + drawingnamesvg = active_sheet.name + drawingname = drawingnamesvg.split('.')[0] + ifc_file = tool.Ifc.get() + ifc_annotations = ifc_file.by_type('IfcAnnotation') + for annotation in ifc_annotations: + if annotation.Name == drawingname: + drawingid = annotation.id() + drawing_button = row.row(align=True) + op = drawing_button.operator("bim.activate_drawing", icon="OUTLINER_OB_CAMERA", text="") + op.drawing = drawingid + row.operator("bim.edit_sheet", icon="GREASEPENCIL", text="") row.operator("bim.open_sheet", icon="URL", text="") row.operator("bim.add_drawing_to_sheet", icon="IMAGE_PLANE", text="")