-
Notifications
You must be signed in to change notification settings - Fork 5
/
SlcrGui.py
69 lines (63 loc) · 1.98 KB
/
SlcrGui.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
# -*- coding: utf-8 -*-
# FreeCAD tools of the Slcr workbench
# (c) 2001 Juergen Riegel
# License LGPL
import FreeCAD, FreeCADGui, os, Slcr
class CmdExportVisible:
def Activated(self):
Slcr.devReload()
Slcr.exportVisible()
def IsActive(self):
return True
def GetResources(self):
return {
'Pixmap': os.path.dirname(__file__)+"/Resources/icons/Stl.svg",
'MenuText': 'Export visible as .stl',
'ToolTip':
"Export visible as .stl\n\n"+
"Before you can run this command you need\n"+
"to save the document to give it a name."
}
class CmdSlice:
def Activated(self):
Slcr.devReload()
Slcr.slice()
def IsActive(self):
return True
def GetResources(self):
return {
'Pixmap': os.path.dirname(__file__)+"/Resources/icons/Slic3r.svg",
'MenuText': 'Run Slic3r',
'ToolTip':
"Run Slic3r"
}
class CmdSliceInfo:
def Activated(self):
Slcr.devReload()
Slcr.sliceInfo()
def IsActive(self):
return True
def GetResources(self):
return {
'Pixmap': os.path.dirname(__file__)+"/Resources/icons/Slic3rInfo.svg",
'MenuText': 'Get slicing info',
'ToolTip':
"Get Slic3r info"
}
class CmdExportGcode:
def Activated(self):
Slcr.devReload()
Slcr.exportGcode()
def IsActive(self):
return True
def GetResources(self):
return {
'Pixmap': os.path.dirname(__file__)+"/Resources/icons/Slic3rGcode.svg",
'MenuText': 'Export visible as .gcode',
'ToolTip':
"Export visible as .gcode"
}
FreeCADGui.addCommand('Slcr_ExportVisible', CmdExportVisible())
FreeCADGui.addCommand('Slcr_Slice', CmdSlice())
FreeCADGui.addCommand('Slcr_SliceInfo', CmdSliceInfo())
FreeCADGui.addCommand('Slcr_ExportGcode', CmdExportGcode())