示例#1
0
    #Log("PATH after addition: " + os.environ["PATH"] + "\n")
    #Log("path extension: " + PathExtension + "\n")


#			else:
#				FreeCAD.PrintMessage('new! install it...\n')
#				InstallFile = os.path.join(os.path.join(ModDir,Dir),"Install.py")
#				if ( os.path.exists(InstallFile) ):
#					execfile(InstallFile)
#				else:
#					Wrn("         Install.py not found! "+Dir+" not installed!\n")

# some often used shortcuts (for lazy people like me ;-)
App = FreeCAD
Log = FreeCAD.PrintLog
Msg = FreeCAD.PrintMessage
Err = FreeCAD.PrintError
Wrn = FreeCAD.PrintWarning

Log('\nInit: starting App::FreeCADInit.py\n')

# init every application by importing Init.py
InitApplications()

FreeCAD.EndingAdd("FCStd", "FreeCAD")

# set to no gui, is overwriten by InitGui
App.GuiUp = 0

Log('\nInit: App::FreeCADInit.py done\n')
示例#2
0
    # add MacroDir to path (RFE #0000504)
    sys.path.append(MacroDir)
    # add special path for MacOSX (bug #0000307)
    import platform
    if len(platform.mac_ver()[0]) > 0:
        sys.path.append(
            os.path.expanduser('~/Library/Application Support/FreeCAD/Mod'))


# some often used shortcuts (for lazy people like me ;-)
App = FreeCAD
Log = FreeCAD.Console.PrintLog
Msg = FreeCAD.Console.PrintMessage
Err = FreeCAD.Console.PrintError
Wrn = FreeCAD.Console.PrintWarning

Log('Init: starting App::FreeCADInit.py\n')

# init every application by importing Init.py
InitApplications()

FreeCAD.EndingAdd("FreeCAD document (*.FCStd)", "FreeCAD")

# set to no gui, is overwritten by InitGui
App.GuiUp = 0

# clean up namespace
del (InitApplications)

Log('Init: App::FreeCADInit.py done\n')
示例#3
0
                else:
                    Log('Init:        done\n')
            else:
                Wrn("InitGui.py not found! " + Dir + " not initialized!\n")


Log('Init: starting Gui::FreeCADGuiInit.py\n')

# init the gui

# signal that the gui is up
App.GuiUp = 1
App.Gui = FreeCADGui

Gui.AddWorkbenchHandler("<none>", StandardWorkbench())

# init modules
InitApplications()

# set standard workbench (needed as fallback)
Gui.ActivateWorkbench("<none>")

# Register .py, .FCScript and .FCMacro
FreeCAD.EndingAdd("py", "FreeCADGui")
FreeCAD.EndingAdd("iv", "FreeCADGui")
FreeCAD.EndingAdd("wrl", "FreeCADGui")
FreeCAD.EndingAdd("FCMacro", "FreeCADGui")
FreeCAD.EndingAdd("FCScript", "FreeCADGui")

Log('Init: Gui::FreeCADGuiInit.py done\n')