Scripting

This page is the starting point for scripting in FreeCAD. As FreeCAD use Python as its scripting language we encourage you to first learn the basics of Python programming before continuing with this documentation.

In the FreeCAD Help Menu, you will also find a "Python help" entry, which will open a complete description of the python modules, classes and functions available to you in FreeCAD.

Basics

 * Official Python tutorial
 * FreeCAD Scripting Basics

Modules
As the functionality of FreeCAD is separated in Module which deal with special data types and applications, here is the starting points for the special scripting:

Meshes
The Mesh Module handles all kind of meshes. Scripting is described in the Mesh Scripting Article.

Part
The Part Module deals with the CAD data structures.

Drawing/Reporting
The Drawing Module is in place for bringing the 3D world onto paper or drawings.

Cam
The Cam Module is dedicated to mechanical machining like milling.

Raytracing
The Raytracing Module brings all kind of shapes to renderers (like PovRay).

Draft
The Draft Module adds basic 2d drawing functions to freecad.

Misc
code snippets : A collection of pieces of FreeCAD python code, to serve as ingredients in your scripts...

Extra python modules : Extend the FreeCAD python interpreter with these powerful modules!

FreeCAD vector math library : A couple of handy functions to manipulate FreeCAD vectors.