Builtin modules: Difference between revisions

From FreeCAD Documentation
No edit summary
 
((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, see Source documentation)
(34 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, see [[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>
=== [[FreeCAD_API|The FreeCAD module]] === <!--T:1-->


=== [[Base_API|Base]] === <!--T:2-->
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.


=== [[Vector_API|Vectors]] === <!--T:3-->
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.


=== [[Matrix_API|Matrixes]] === <!--T:4-->
=== Base sub-module ===

=== Console sub-module ===
=== [[Console_API|Console module]] === <!--T:5-->

=== [[FreeCADGui_API|The FreeCADGui Module]] === <!--T:6-->

=== [[Selection_API|Selection module]] === <!--T:7-->

=== [[Placement_API|Placement]] === <!--T:8-->

=== [[Object_API|Document Objects]] === <!--T:9-->

=== [[ViewObject_API|View Objects]] === <!--T:10-->

<!--T:11-->
[[Category:API]]
[[Category:Poweruser Documentation]]

</translate>
{{clear}}

Revision as of 00:37, 2 October 2019

(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, see 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.

The FreeCAD module

Base

Vectors

Matrixes

Console module

The FreeCADGui Module

Selection module

Placement

Document Objects

View Objects