Beispiel #1
0
            "RC_ExportURDF",
        ]  # A list of command names created in the line above
        self.appendToolbar(
            "RobotCreator",
            self.list)  # creates a new toolbar with your commands
        self.appendMenu("My New Menu", self.list)  # creates a new menu
        self.appendMenu(["An existing Menu", "My submenu"],
                        self.list)  # appends a submenu to an existing menu
        FreeCADGui.addIconPath("~/.FreeCAD/Mod/RobotCreator/icons")

    def Activated(self):
        "This function is executed when the workbench is activated"
        return

    def Deactivated(self):
        "This function is executed when the workbench is deactivated"
        return

    def ContextMenu(self, recipient):
        "This 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
        return "Gui::PythonWorkbench"


Gui.addWorkbench(RobotCreator())
Beispiel #2
0
"                "};
"""

    def Initialize(self):
        import ExportPanel
        import MakeBoxPanel
        import MakeRoundedBoxPanel
        from panel import multiplejoins, crosspiece, livinghinge
        all_command = [
            "make_box_command", "multiple_tabs_command", "crosspiece"
        ]
        self.appendToolbar("Tab", all_command)
        self.appendToolbar("Hinge",
                           ["make_rounded_box_command", "livinghinge"])
        self.appendToolbar("Export", ["export_command"])

    def Activated(self):
        return

    def Deactivated(self):
        return

    def ContextMenu(self, recipient):
        self.appendContextMenu("My commands", self.list)

    def GetClassName(self):
        return "Gui::PythonWorkbench"


Gui.addWorkbench(LCInterlockingWorkbench())
".............   ",
".............   ",
"        ....    ",
"         ..     ",
"       .    .   ",
"      .      .  ",
"     .        . ",
"                ",
"                "};
"""
 
    def Initialize(self):
        import ExportPanel
        from panel import multiplejoins
        cmd_list = ["multiple_tabs_command", "export_command"]  # A list of command names created in the line above
        self.appendToolbar("Laser Cut Commands", cmd_list)  # creates a new toolbar with your commands
 
    def Activated(self):
        return
 
    def Deactivated(self):
        return
 
    def ContextMenu(self, recipient):
        self.appendContextMenu("My commands", self.list)
 
    def GetClassName(self):
        return "Gui::PythonWorkbench"
 
Gui.addWorkbench(LCInterlockingWorkbench())