I solved the same problem by creating a new wokbench called Run Startup Script, which you can do by putting the following code in a file in .FreeCAD/Mod/Run_Startup
Code: Select all
class RunStartupWorkbench (Workbench):
# Icon generated using by converting linearDimension.svg to xpm format using Gimp
Icon = '''
/* XPM */
static char * linearDimension_xpm[] = {
"32 32 10 1",
" c None",
". c #000000",
"+ c #0008FF",
"@ c #0009FF",
"# c #000AFF",
"$ c #00023D",
"% c #0008F7",
"& c #0008EE",
"* c #000587",
"= c #000001",
". .",
". .",
". .",
". .",
". .",
". .",
". .",
". .",
". .",
". .",
". .",
". .",
". +@@ + .",
". @+@@+ +@@+@ .",
". +@+@@@@@@ @@@@@@@# .",
"$%@@@@@@@@@+@@@@@@@@@@@@@@@@@@&$",
". #@@@@@@@@ #+@@@@@@@@*=",
". @+@@+ +@@@@@ .",
". +@ #@++ .",
". # .",
". .",
". .",
". .",
". .",
". .",
". .",
". .",
". .",
". .",
". .",
". .",
". ."};
'''
MenuText = 'Run Startup Script'
def Initialize(self):
FreeCADGui.doCommand("execfile('/home/rcrozier/.FreeCAD/startup.FCMacro')")
Gui.addWorkbench(RunStartupWorkbench())
If you then make this the default startup workbench it will run whatever you put in startup.FCMacro referenced toward the end in the python interpreter every time you start FreeCAD.