Builtin modules

The App module
The App module is also called the FreeCAD module. If you import it in an external script, you must call it by its FreeCAD name. The App name is only availible from the interpreter.

The functions in the FreeCAD module allow working with documents. The FreeCAD instance provides a list of references of documents which can be addressed by a string. Hence the document name must be unique. The document has the read-only attribute FileName which points to the file the document should be stored to.

The list below is an overview of the principal tools and functions availible to you. Be aware that FreeCAD evolves at a quite fast pace, and in new versions you might have much more functionality availible.

Main Functions

 * ConfigDump -- Dump the configuration to the output.
 * ConfigGet([string]) -- Get the value for the given key. If no key is given the complete configuration is dumped to the output.
 * ConfigSet(string, string) -- Set the given key to the given value.
 * Version -- Print the version to the output.
 * activeDocument -- Return the active document or None if there is no active document.
 * addExportType("File type (*.ext)","script") -- Registers a filetype for export. The "script" string is the name of a python containing an export function
 * addImportType("File type (*.ext)","script") -- Registers a filetype for import. The "script" string is the name of a python containing an import or an open function, or both.
 * closeDocument(string) -- Closes the given document
 * getDocument(string) -- returns a document or raise an exception if there is no document with the given name.
 * getExportType("ext") -- Get the name of the module that can export the filetype
 * getImportType("ext) -- Get the name of the module that can import the filetype
 * listDocuments -- Return a list of names of all documents.
 * newDocument([string]) -- Create a new document with a given name. The document name must be unique which is checked automatically. If no name is supplied, the document will be named "Untitled". The created document object is returned.
 * open(string) -- See openDocument(string)
 * openDocument(string) -- Create a document and load the project file into the document. The string argument must point to an existing file. If the file doesn't exist or the file cannot be loaded an I/O exception is thrown. In this case the document is kept alive. The created document object is returned.
 * setActiveDocement(string) -- Set the active document by its name.