mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 18:22:30 +00:00
Fix #3728 - Be able to bim.activate_drawing a drawing listed in the sheets UI, as well.
This commit is contained in:
@@ -430,6 +430,19 @@ class BIM_PT_sheets(Panel):
|
|||||||
active_sheet = self.props.sheets[self.props.active_sheet_index]
|
active_sheet = self.props.sheets[self.props.active_sheet_index]
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.alignment = "RIGHT"
|
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.edit_sheet", icon="GREASEPENCIL", text="")
|
||||||
row.operator("bim.open_sheet", icon="URL", text="")
|
row.operator("bim.open_sheet", icon="URL", text="")
|
||||||
row.operator("bim.add_drawing_to_sheet", icon="IMAGE_PLANE", text="")
|
row.operator("bim.add_drawing_to_sheet", icon="IMAGE_PLANE", text="")
|
||||||
|
|||||||
Reference in New Issue
Block a user