Builtin modules: Difference between revisions

From FreeCAD Documentation
No edit summary
 
(Marked this version for translation)
 
(39 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<languages/>
== The App module ==
<translate>
<!--T:13-->
{{VeryImportantMessage|(October 2019) Do not edit these pages. The information is incomplete and outdated. For the latest API, see the [https://www.freecadweb.org/api autogenerated API documentation], or generate the documentation yourself by following [[Source documentation|Source documentation]].}}


<!--T:12-->
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.
This page presents more in-depth information over the built-in FreeCAD modules, and what are the functions and properties availible to you. This page is not a complete list of all the contents of these modules, and, because of the fast evolution of FreeCAD, the information presented here might be slightly outdated, but it should give you a good overview of the possibilities. For complete list of the modules content, use the dir(module) function in the interpreter.
</translate>
__NOTOC__
<translate>


== Non graphical == <!--T:14-->
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.


<!--T:1-->
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.
* [[FreeCAD_API|The FreeCAD module]]
* [[Base_API|Base]]
=== Main Functions ===
* [[Vector_API|Vectors]]
* [[Matrix_API|Matrices]]
* ConfigDump() -- Dump the configuration to the output.
* [[Console_API|Console module]]
* ConfigGet([string]) -- Get the value for the given key. If no key is given the complete configuration is dumped to the output.
* [[Placement_API|Placement]]
* ConfigSet(string, string) -- Set the given key to the given value.
* [[Object_API|Document Objects]]
* 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.


== Graphical == <!--T:15-->
=== Base sub-module ===

=== Console sub-module ===
<!--T:6-->
* [[FreeCADGui_API|The FreeCADGui Module]]
* [[Selection_API|Selection module]]
* [[ViewObject_API|View Objects]]

</translate>
{{Powerdocnavi{{#translation:}}}}
[[Category:API{{#translation:}}]]
{{clear}}

Latest revision as of 11:33, 15 May 2020

(October 2019) Do not edit these pages. The information is incomplete and outdated. For the latest API, see the autogenerated API documentation, or generate the documentation yourself by following Source documentation.

This page presents more in-depth information over the built-in FreeCAD modules, and what are the functions and properties availible to you. This page is not a complete list of all the contents of these modules, and, because of the fast evolution of FreeCAD, the information presented here might be slightly outdated, but it should give you a good overview of the possibilities. For complete list of the modules content, use the dir(module) function in the interpreter.


Non graphical

Graphical