Skip to content

Commit

Permalink
demo macro myMacroDir for naming conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
microelly2 committed Apr 27, 2015
1 parent 8967766 commit 49b5f5d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions myMacroDir/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import myMacro
31 changes: 31 additions & 0 deletions myMacroDir/myMacro.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# your copyright info here
#

import FreeCAD


#
# the macro should have a test method to check the sucess 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)




0 comments on commit 49b5f5d

Please sign in to comment.