forked from youen/assembly_handbook
Youen Toupin
3 years ago
4 changed files with 122 additions and 1 deletions
@ -0,0 +1,21 @@ |
|||||||
|
from typing import Optional |
||||||
|
|
||||||
|
import FreeCADGui as Gui |
||||||
|
import FreeCAD as App |
||||||
|
|
||||||
|
class AHB_Animate: |
||||||
|
def GetResources(self): |
||||||
|
return {"MenuText": "Animate", |
||||||
|
"ToolTip": "Animate active stage to show all build stages", |
||||||
|
"Pixmap": "" |
||||||
|
} |
||||||
|
|
||||||
|
def IsActive(self): |
||||||
|
return True |
||||||
|
|
||||||
|
def Activated(self, stageId: Optional[int] = None): |
||||||
|
workbench = Gui.getWorkbench("AssemblyHandbookWorkbench") |
||||||
|
workbench.context.setAnimationActive(not workbench.context.getAnimationActive()) |
||||||
|
|
||||||
|
from ahb_command import AHB_CommandWrapper |
||||||
|
AHB_CommandWrapper.addGuiCommand('AHB_animate', AHB_Animate()) |
@ -0,0 +1,21 @@ |
|||||||
|
from typing import Optional |
||||||
|
|
||||||
|
import FreeCADGui as Gui |
||||||
|
import FreeCAD as App |
||||||
|
|
||||||
|
class AHB_SwitchVisibilityMode: |
||||||
|
def GetResources(self): |
||||||
|
return {"MenuText": "Switch visibility", |
||||||
|
"ToolTip": "Switch visibility mode", |
||||||
|
"Pixmap": "" |
||||||
|
} |
||||||
|
|
||||||
|
def IsActive(self): |
||||||
|
return True |
||||||
|
|
||||||
|
def Activated(self, stageId: Optional[int] = None): |
||||||
|
workbench = Gui.getWorkbench("AssemblyHandbookWorkbench") |
||||||
|
workbench.context.setAllStagesVisible(not workbench.context.getAllStagesVisible()) |
||||||
|
|
||||||
|
from ahb_command import AHB_CommandWrapper |
||||||
|
AHB_CommandWrapper.addGuiCommand('AHB_switchVisibilityMode', AHB_SwitchVisibilityMode()) |
Loading…
Reference in new issue