Youen
2 years ago
4 changed files with 47 additions and 5 deletions
@ -0,0 +1,22 @@ |
|||||||
|
import FreeCADGui as Gui |
||||||
|
import FreeCAD as App |
||||||
|
|
||||||
|
class AHB_RefreshView: |
||||||
|
def GetResources(self): |
||||||
|
return {"MenuText": "Refresh page", |
||||||
|
"ToolTip": "Redraws the current page", |
||||||
|
"Pixmap": "" |
||||||
|
} |
||||||
|
|
||||||
|
def IsActive(self): |
||||||
|
workbench = Gui.getWorkbench("AssemblyHandbookWorkbench") #: :type workbench: AssemblyHandbookWorkbench |
||||||
|
return workbench.techDrawExtensions.getActivePage() is not None |
||||||
|
|
||||||
|
def Activated(self): |
||||||
|
workbench = Gui.getWorkbench("AssemblyHandbookWorkbench") #: :type workbench: AssemblyHandbookWorkbench |
||||||
|
page = workbench.techDrawExtensions.getActivePage() |
||||||
|
if page is not None: |
||||||
|
workbench.techDrawExtensions.forceRedrawPage(page) |
||||||
|
|
||||||
|
from ahb_command import AHB_CommandWrapper |
||||||
|
AHB_CommandWrapper.addGuiCommand('AHB_view_refresh', AHB_RefreshView()) |
Loading…
Reference in new issue