forked from FreeCAD/FreeCAD-macros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyMacro.py
45 lines (33 loc) · 1.04 KB
/
myMacro.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
#
# your copyright info here
#
# meta data for macro management
__Comment__ = 'My macro is a super macro and can be used whenever other macros fail '
__Web__ = "http://forum.freecadweb.org/viewtopic.php?f=8&t=11302"
__Wiki__ = "http://www.freecadweb.org/wiki/Macro_FreeCAD_to_Kerkythea"
__Icon__ = "Part_Common.svg"
__Help__ = "This is the help text of this macro"
__Author__ = "Freek Ad"
__Version__ = 0.1
__Status__ = 'alpha'
__Requires__ = ''
import FreeCAD
#
# the macro should have a test method to check the success of the installation
#
def test():
errorMsg="There are some errors: a, b, c"
warnMsg="There are some warnings: d, e"
infoMsg="There is a info: f"
errors=3
warns=2
infos=1
result=[errors,errorMsg,warns,warnMsg,infos,infoMsg]
return result
#
# the macro should have a main method - the macro itself
#
def main():
t=FreeCAD.ParamGet('User parameter:BaseApp/Preferences/Macro')
mp=t.GetString("MacroPath")
FreeCAD.Console.PrintMessage("\n"*4+"H E L L O W O R L D,\n I'm myMacro.py located in "+ mp+ "/MyMacroDir" + "\n"*4)