|
|
@ -14,11 +14,19 @@ class AHB_View_Annotate: |
|
|
|
def Activated(self): |
|
|
|
def Activated(self): |
|
|
|
workbench = Gui.getWorkbench("AssemblyHandbookWorkbench") #: :type workbench: AssemblyHandbookWorkbench |
|
|
|
workbench = Gui.getWorkbench("AssemblyHandbookWorkbench") #: :type workbench: AssemblyHandbookWorkbench |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(Gui.Selection.getSelection()) == 0: |
|
|
|
|
|
|
|
page = workbench.techDrawExtensions.getActivePage() |
|
|
|
|
|
|
|
workbench.techDrawExtensions.refreshOverlays(page) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
if len(Gui.Selection.getSelection()) != 1: |
|
|
|
if len(Gui.Selection.getSelection()) != 1: |
|
|
|
raise Exception("Please select exactly one TechDraw view") |
|
|
|
raise Exception("Please select exactly one TechDraw view") |
|
|
|
|
|
|
|
|
|
|
|
view = Gui.Selection.getSelection()[0] |
|
|
|
view = Gui.Selection.getSelection()[0] |
|
|
|
if view.TypeId != 'TechDraw::DrawViewPart': |
|
|
|
if view.TypeId == 'TechDraw::DrawPage': |
|
|
|
|
|
|
|
workbench.techDrawExtensions.refreshOverlays(view) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
elif view.TypeId != 'TechDraw::DrawViewPart': |
|
|
|
raise Exception("Selected object is not a TechDraw view") |
|
|
|
raise Exception("Selected object is not a TechDraw view") |
|
|
|
|
|
|
|
|
|
|
|
overlay_view = workbench.techDrawExtensions.getOverlayView(view) |
|
|
|
overlay_view = workbench.techDrawExtensions.getOverlayView(view) |
|
|
@ -61,5 +69,7 @@ class AHB_View_Annotate: |
|
|
|
for partLink in view.XSource: |
|
|
|
for partLink in view.XSource: |
|
|
|
workbench.techDrawExtensions.add_or_update_balloon(view, partLink, '') |
|
|
|
workbench.techDrawExtensions.add_or_update_balloon(view, partLink, '') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
workbench.techDrawExtensions.refreshOverlays(page) |
|
|
|
|
|
|
|
|
|
|
|
from ahb_command import AHB_CommandWrapper |
|
|
|
from ahb_command import AHB_CommandWrapper |
|
|
|
AHB_CommandWrapper.addGuiCommand('AHB_view_annotate', AHB_View_Annotate()) |
|
|
|
AHB_CommandWrapper.addGuiCommand('AHB_view_annotate', AHB_View_Annotate()) |
|
|
|