import FreeCAD as App class LaserCladding (Workbench): MenuText = "Laser Cladding" ToolTip = "Create Simple Path on workpieces for Laser Cladding" Icon = """""" def __init__(self): __dirname__ = os.path.join(FreeCAD.getUserAppDataDir(), "Mod", "LaserCladding") _tooltip = "The LaserCladding Workbench can create Paths for Robots" self.__class__.Icon = os.path.join(__dirname__, "Resources", "icons", "Laser_Workbench.svg") def Initialize(self): """This function is executed when the workbench is first activated. It is executed once in a FreeCAD session followed by the Activated function. """ import lasercladding self.list = ["CreateCladdingJob", "SelectBaseReference", "CreatePad"] # A list of command names created in the line above self.appendToolbar("My Commands",self.list) # creates a new toolbar with your commands self.appendMenu("LaserCladding",self.list) # creates a new menu self.appendMenu(["LaserCladding","My submenu"],self.list) # appends a submenu to an existing menu def Activated(self): """This function is executed whenever the workbench is activated""" #from importlib import reload #reload(lccmd) return def Deactivated(self): """This function is executed whenever the workbench is deactivated""" return def ContextMenu(self, recipient): """This function is executed whenever the user right-clicks on screen""" # "recipient" will be either "view" or "tree" self.appendContextMenu("My commands",self.list) # add commands to the context menu def GetClassName(self): # This function is mandatory if this is a full Python workbench # This is not a template, the returned string should be exactly "Gui::PythonWorkbench" return "Gui::PythonWorkbench" Gui.addWorkbench(LaserCladding())