To use milling macros

Macros can be generated in the NC code for multiple Z levels of a milled feature. To generate these macros, your post processor must support them, and you must turn this function on for the post.

  1. Select File > Options > Posting.
  2. Select your post processor.
  3. Deselect Disable Macros.
  4. Click OK.
  5. Select Features & Manufacturing tab > Options panel > Machining Attributes.
  6. On the Operations page, click the Automatic Options button and selectMinimize tool changes.

    You could set Minimize tool changes in the Ordering dialog instead. Using the Default Attributes setting includes macros for any parts you create.

    Minimize tool changes groups operations together that use the same tool. This saves time for you by eliminating or reducing needless tool changes. You must select this check box if you want to generate hole macros in the NC code.

  7. Turn off Minimize rapid distance.

    This attribute affects only milling setups and is the only ordering option that changes the order of features specified in the part view. Minimize Rapid Distance moves to the next closest feature that uses the same tool as the last operation. You must deselect this option if you want to generate hole macros in the NC code.

  8. Click OK.

Now when you generate NC code, you get macros for the milled features that are milled at multiple Z depths.

Incremental programming and local coordinate systems

You can use milling macros (also called subprograms or subroutines) in patterns. To enable milling macros in patterns, select Use macro calls for each instance in the pattern in the Strategy tab of the Pattern Properties dialog.

Incremental programming means that the moves in the subroutine are relative instead of absolute. Instead of moving to a particular absolute location inside of the macro, the moves are relative to the current position, such as move two additional inches in X. An example G-code is Fanuc's G91 for relative programming.

When using local coordinate systems, the coordinate systems are constantly being redefined outside of the macro and the moves within the macro are absolute. Examples of this concept are Fanuc's G92, Heidenhain's Datum Shift and Siemen's G58.

The actual G-code created for a particular pattern depends on the macro programming options that are supported by the post processor.