FreeCAD Macros

From Open Source Ecology
Jump to: navigation, search

About

  • Macros are Python programs in FreeCAD that can be used to add functionality or shortcuts to FreeCAD.
  • Useful for rapid workflow: if you have a bunch of steps to communicate through the user interface - just activate a macro instead to save you time.
  • Sometimes these programs require supporting data files, such as CSVs or PNGs - or whatever supporting data that the macro requires.

Examples

Set yourself up for rapid rotation of objects:

FreeCAD.DraftWorkingPlane.alignToPointAndAxis(FreeCAD.Vector(0,0,0), FreeCAD.Vector(-0.0,-1.0,-0.0), 0) FreeCADGui.Snapper.setGrid(init=True)

Adding Downloaded Macros

  • To add a macro to FreeCAD - find the Macros directory by going to FreeCAD->File->Preferences->Macros - which shows the macros directory such as /home/marcin/.FreeCAD
  • Download a macro
  • Drag and drop the macro into the Macros directory
  • Drag and drop any supporting data files into the same directory

Installing and Running Macros

Macros Under Development

FreeCAD Source

Macros of interest