FreeCAD Logo FreeCAD 1.0
  • English Afrikaans Arabic Belarusian Catalan Czech German Greek Spanish Spanish Basque Finnish Filipino French Galician Croatian Hungarian Indonesian Italian Japanese Kabyle Korean Lithuanian Dutch Norwegian Bokmal Polish Portuguese Portuguese Romanian Russian Slovak Slovenian Serbian Swedish Turkish Ukrainian Valencian Vietnamese Chinese Chinese
  • Features
  • Download
  • Blog
  • Documentation
    Documentation index Getting started Users documentation The FreeCAD manual Workbenches documentation Python coding documentation C++ coding documentation Tutorials Frequently asked questions Privacy policy About FreeCAD
  • Contribute
    How to help Sponsor Report a bug Make a pull request Jobs and funding Contribution guidelines Developers handbook Translations
  • Community
    Code of conduct Forum The FPA GitHub GitLab Codeberg Mastodon Matrix IRC IRC via Webchat Gitter Discord Reddit Twitter Facebook LinkedIn Calendar
  • ♥ Donate

Donate

$
SEPA Information
Please set up your SEPA bank transfer to:
Beneficiary: The FreeCAD project association
IBAN: BE04 0019 2896 4531
BIC/SWIFT: GEBABEBBXXX
Bank agency: BNP Paribas Fortis
Address: Rue de la Station 64, 1360 Perwez, Belgium

While Stripe doesn't support monthly donations, you can still become a sponsor! Simply make a one-time donation equivalent to 12 months of support, and you'll gain access to the corresponding sponsoring tier. It's an easy and flexible way to contribute.

If you are not sure or not able to commit to a regular donation, but still want to help the project, you can do a one-time donation, of any amount.

Choose freely the amount you wish to donate one time only.

You can support FreeCAD by sponsoring it as an individual or organization through various platforms. Sponsorship provides a steady income for developers, allowing the FPA to plan ahead and enabling greater investment in FreeCAD. To encourage sponsorship, we offer different tiers, and unless you choose to remain anonymous, your name or company logo will be featured on our website accordingly.

from 1 USD / 1 EUR per month. You will not have your name displayed here, but you will have helped the project a lot anyway. Together, normal sponsors maintain the project on its feet as much as the bigger sponsors.

from 25 USD / 25 EUR per month. Your name or company name is displayed on this page.

from 100 USD / 100 EUR per month. Your name or company name is displayed on this page, with a link to your website, and a one-line description text.

from 200 USD / 200 EUR per month. Your name or company name and logo displayed on this page, with a link to your website and a custom description text. Companies that have helped FreeCAD early on also appear under Gold sponsors.

Instead of donating each month, you might find it more comfortable to make a one-time donation that, when divided by twelve, would give you right to enter a sponsoring tier. Don't hesitate to do so!

Choose freely the amount you wish to donate each month.

Please inform your forum name or twitter handle as a notein your transfer, or reach to us, so we can give you proper credits!

FreeCAD API

(October 2019) Do not edit this page. 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.

This is the principal (root) module of FreeCAD. It can also be called by \"App\" from the FreeCAD interpreter. It contains everything that is needed to manipulate documents and their contents (objects).

Example:

import FreeCAD
print FreeCAD.listDocuments()
mydoc = FreeCAD.activeDocument()

{{APIFunction|ConfigDump| |Prints a dictionary containing all the FreeCAD configuration environment.| }}

{{APIFunction|ConfigGet|[string]|Returns the value of the given key. If no key is given, the complete configuration is returned|A string.}}

{{APIFunction|ConfigSet|string, string|Set the given key (first string) to the given value (second string).| }}

{{APIFunction|Version| |Prints the FreeCAD version.| }}

{{APIFunction|activeDocument| |Return the active document or None if there is no active document.|A FreeCAD Document.}}

{{APIFunction|addExportType|string, string|Adds a new export file type to FreeCAD. The first string must be formatted like this example: "Word Document (*.doc)". The second string is the name of a python script/module containing an export() function.| }}

{{APIFunction|addImportType|string, string|Adds a new import file type to FreeCAD, works the same way as addExportType, the handling python module must contain an open() and/or an import() function.| }}

{{APIFunction|closeDocument|Document name|Closes the given document| }}

{{APIFunction|getDocument|Document name|Returns a document or raise an exception if there is no document with the given name.| }}

{{APIFunction|getExportType|string|Returns the name of the module that can export the specified filetype.| A string.}}

{{APIFunction|getImportType|string|Returns the name of the module that can import the specified filetype.|A string.}}

{{APIFunction|listDocuments| |Returns a dictionary of names and object pointers of all documents.|A dictionary of names and object pointers.}}

{{APIFunction|newDocument|[string], [hidden=False]|Creates and returns 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". If hidden=True is passed, then FreeCAD in GUI mode won't display the document and won't show a tab for the document; this allows performing automatic operations on a temporary document (or create a document and save it) without disrupting the user interface.|The newly created document.}}

{{APIFunction|open|string|See openDocument| }}

{{APIFunction|openDocument|filepath, [hidden]|Creates and returns a document and load a 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 created document is kept, but will be empty. If hidden=True is passed, then FreeCAD in GUI mode won't display the document and won't show a tab for the document; this allows performing automatic operations on a document and close it without disrupting the user interface.|The opened FreeCAD Document.}}

{{APIFunction|setActiveDocument|Document name|Set the active document by its name.| }}


⏵ documentation index > API > Poweruser Documentation > FreeCAD API

This page is retrieved from https://github.com/FreeCAD/FreeCAD-documentation/blob/main/wiki/FreeCAD_API.md

Get in touch!
Forum GitHub Mastodon Matrix IRC Gitter.im Discord Reddit Twitter Facebook LinkedIn

© The FreeCAD Team. Homepage image credits (top to bottom): ppemawm, r-frank, epileftric, regis, rider_mortagnais, bejant.

This project is supported by: , KiCad Services Corp. and other sponsors

GitHubImprove this page on GitHub