Units
Some reading about units:
Examples
# -- some examples of the FreeCAD unit translation system --
# make a shortcut for the examples
pq = FreeCAD.Units.parseQuantity
# 10 meters in internal numbers
pq('10 m')
# doing math
pq('3/8 in')
# combined stuff
pq('100 km/h')
# transfer to other units
pq('100 km/h')/tu('m/s')
# derived units (Ohm)
pq('m^2*kg*s^-3*A^-2')
# or
pq('(m^2*kg)/(A^2*s^3)')
# angles
pq('2*pi rad') # full circle
# as gon
pq('2*pi rad') / tu('gon')
# more imperial
tu('1ft (3+7/16)in')
# or
pq('1\' (3+7/16)"') # the ' we have to escape because of python
# trigonometry
pq('sin(pi)')
# Using translated units as parameters, this command will create a 50.8mm x 20mm x 10mm box
b = Part.makeBox(pq('2in'), pq('2m')/100, 10)
Supported units
A complete list of all supported units can be found here.
See Also
- The Expressions page for a list of all known units.
- The documentation of Quantity.
- The Std UnitsCalculator tool.

- FreeCAD scripting: Python, Introduction to Python, Python scripting tutorial, FreeCAD Scripting Basics
- Modules: Builtin modules, Units, Quantity
- Workbenches: Workbench creation, Gui Commands, Commands, Installing more workbenches
- Meshes and Parts: Mesh Scripting, Topological data scripting, Mesh to Part, PythonOCC
- Parametric objects: Scripted objects, Viewproviders (Custom icon in tree view)
- Scenegraph: Coin (Inventor) scenegraph, Pivy
- Graphical interface: Interface creation, Interface creation completely in Python (1, 2, 3, 4, 5), PySide, PySide examples beginner, intermediate, advanced
- Macros: Macros, How to install macros
- Embedding: Embedding FreeCAD, Embedding FreeCADGui
- Other: Expressions, Code snippets, Line drawing function, FreeCAD vector math library (deprecated)
- Hubs: User hub, Power users hub, Developer hub