forked from youen/assembly_handbook
23 lines
810 B
Python
23 lines
810 B
Python
import FreeCADGui as Gui
|
|
import FreeCAD as App
|
|
|
|
class AHB_RefreshViewFast:
|
|
def GetResources(self):
|
|
return {"MenuText": "Refresh page (fast)",
|
|
"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, fast_render = True)
|
|
|
|
from ahb_command import AHB_CommandWrapper
|
|
AHB_CommandWrapper.addGuiCommand('AHB_view_refresh_fast', AHB_RefreshViewFast())
|