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 availibles 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 deal with the CAD data structures. E.g. Creating topology

Drawing/Reporting
The Drawing Module is in place for bring the 3D world on a paper/drawing.

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

Raytracing
The Raytracing Module brings all kind of shapes to renders (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.