FreeCAD workbench to create assembly handbooks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
960 B

import FreeCADGui as Gui
import FreeCAD as App
from PySide import QtGui
class AHB_SetActiveStage:
def GetResources(self):
return {"MenuText": "Set active stage",
"ToolTip": "Sets the stage which is the active stage, or creates a new stage if it doesn't exist",
"Pixmap": ""
}
def IsActive(self):
return True
def Activated(self, stageId = None):
if stageId is None:
reply = QtGui.QInputDialog.getText(None, "Set Active Stage", "Enter the stage number:")
if reply[1]:
# user clicked OK
stageId = int(reply[0])
else:
return
workbench = Gui.getWorkbench("AssemblyHandbookWorkbench")
workbench.context.setActiveStage(stageId)
from ahb_command import AHB_CommandWrapper
AHB_CommandWrapper.addGuiCommand('AHB_setActiveStage', AHB_SetActiveStage())