Macros recipes

From FreeCAD Documentation
Revision as of 21:26, 19 September 2011 by Galou breizh (talk | contribs) (Added Macro_MessageBox)

This page contains macros to add functionality to your freecad installation

Macros

Object creation

Object transformation

3D View operations

  • Macro Rotate View This macro rotates the current view by 90° to the left. Only works if you are in Top view.

Wizards

  • Macro Automatic drawing: allows the user to get the view of his object in a drawing with 4 different position(front,top,iso,right). Need some modification to be perfecly effective
  • Macro Corner shapes wizard: pops up a dialog asking for the dimensions of your corner piece, then creates the object in the document and creates a page view with top, front and lateral views of the piece

Utility

How to use?

The above macros can easily be plugged on any FreeCAD installation

  • Copy the macro python code from the corresponding macro page
  • Paste it in a blank text document (for example using notepad on windows or gedit on ubuntu)
  • Save the text file with a .FCMacro extension
  • move the .FCMacro file to the FreeCAD user folder (/home/yourUser/.FreeCAD on unixes, C:\Users\yourUser\Application Data\FreeCAD on windows)
  • restart FreeCAD
  • Open the Macro manager, select your new macro and click "execute"

Additionally, you can also add your new macro to a custom toolbar

  • In FreeCAD, go to Tools -> Customize
  • In the Macros tab, add a new macro, and, if you like, define an icon and a keyboard shortcut
  • In the Toolbars tab, create a new toolbar, and add your macro, taking it from the "Macros" category.

Adding new macros to this repository

  • Create a new page, beginning its name with "Macro", for example "Macro_My_Excellent_Macro"
  • In that page, paste the following text:
{{Macro|Name=My Excellent Macro|Description=What my excellent macro does|Author=your username}}
  • If you like, upload a .png icon with the exact same name as your macro page (ex. Macro_My_Excellent_Macro.png)
  • Add it to the above categories, create a new category if needed
Available translations of this page: Template:Se