Creating a macro

In this task, you will use the Macro Recording menu features to perform a basic remodeling task.

You will then play the Macro and be introduced to the two types of folders used for storing Macro scripts.

  1. Enter -5 -20 0 in the Rotation Angle, View tab Rotation Angles box (View tab > Viewpoint panel > Rotation Angle).
  2. Click Record Macro, Tools tab (Tools tab > Automation panel > Record Macro).
  3. Click Geometry, Home tab (Home tab > Create panel > Geometry) to open the Geometry tab.
  4. Click Move, Geometry tab (Geometry tab > Utilities panel > Move) and select Translate, Geometry tab Translate from the drop-down menu. The Translate pane opens on the Tools tab.
  5. From the Filter drop-down menu on the Translate pane, select Nearest Node.
  6. Click in the Select text box on the Translate pane.
  7. Hold down the Ctrl key and select the nodes shown in the following image:

  8. Click in the Vector (x, y, z) box on the Translate pane. Ignore the Measurements dialog if it appears.
  9. Type 0 0 0.5 (mm) in the Vector (x, y, z) box.
  10. Click Apply, then click Close.
  11. Click Stop Recording, Tools tab (Tools tab > Automation panel > Stop Recording).

    The Save Macro dialog appears.

  12. Enter task_extend in the File name box and click Save.

    You have just recorded this sequence of actions. You can now reproduce this sequence of actions any time you wish by running the macro that you saved. To illustrate this, reset the model to its original condition using the steps below, and then run the macro.

  13. Click Undo (Undo) on the Quick Access toolbar.
  14. Click Deselect All, Geometry tab Deselect All from the Selection drop-down menu (Geometry tab > Selection panel > Deselect All).
  15. Click Front view, ViewCube Front View on the ViewCube.

    You have now returned the model to its original state.

  16. Click Play Macro, Tools tab (Tools tab > Automation panel > Play Macro).

    The Open Macro dialog appears. Move the dialog to the side so that you can see the model.

  17. Select the macro file you just created and click Open.

    The macro plays and extends the nodes. Rotate the model to observe the changes.

  18. Click Undo (Undo) on the Quick Access toolbar to return the model to its original state.

When you stopped macro recording and saved the macro, you saved it to the scripts directory under your project home directory. This setting can be changed on the Directories tab of the Options dialog ( > Options).

In the next task, you will run another type of script from the Command line and be introduced to the commands folder also located in the same directory as your script folder. This is where all the command line scripts are saved. Each script can be activated through the Command Line feature.

Click the Next topic link below to move on to the next task of the tutorial.