-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInitGui.py
72 lines (61 loc) · 2.41 KB
/
InitGui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# -*- coding: utf-8 -*-
__title__= "FreeCAD Foamcut Workbench - Init file"
__author__ = "Andrew Shkolik & Andrei Bezborodov"
__license__ = "LGPLv2.1"
__url__ = ["http://www.freecadweb.org"]
import FreeCAD
App=FreeCAD
import FreeCADGui
Gui=FreeCADGui
class FoamcutWB (Workbench):
def __init__(self):
import os
import utilities
self.__class__.MenuText = "FoamCut"
self.__class__.ToolTip = "Foamcut workbench provide functionality to prepare job and generate Gcode for 4 or 5 axis cnc hotwire cutter."
self.__class__.Icon = utilities.getIconPath("foamcut.svg")
def Initialize(self):
"This function is executed when FreeCAD starts"
# import here all the needed files that create your FreeCAD commands
import utilities
import InitMachine
import WirePath
import WireEnter
import WireExit
import WireMove
import WireJoin
import Rotate
import WireRoute
import Postprocess
import MirrorGcode
import WireProjection
self.examples = [] # A list of command names to create example project
self.list = [
"InitMachine",
"MakePath",
"MakeProjection",
"MakeEnter",
"MakeExit",
"MakeMove",
"Join",
"Rotate",
"Route",
"MakeGcode",
"MirrorGcode"] # A list of command names created in the line above
self.appendToolbar("FoamCut",self.list) # creates a new toolbar with your commands
self.appendMenu("FoamCut",self.list) # creates a new menu
self.appendMenu("FoamCut",self.examples) # creates a new menu
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("FoamCut",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(FoamcutWB())