forked from youen/assembly_handbook
22 lines
699 B
Python
22 lines
699 B
Python
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())
|