Exercise 2: Automate AutoCAD commands

To complete the workflow definition, add the layers to a group and automate an AutoCAD command. Then save and test the workflow.

Note:

This exercise uses the workflow you modified in Exercise 1: Automate grouping layers.

To complete the workflow definition

  1. If the workflow you started in Exercise 1: Automate grouping layers is not still open, open it.
  2. Drag the Run AutoCAD Command activity from the activity panel and place it just after the LoopAddLayers activity in the workflow.

    Use a command line option to save the current map as a separate DWG file. You can run any command that you can enter on the command line.

    Because this activity applies to the entire map, it does not have to loop. Therefore, you place it outside the LoopAddLayers activity

  3. Double-click the Run AutoCAD Command activity and set its parameters as follows:
    • For Command, enter mapexportcurrentmaptodwg.
    • Under Show Optional Parameters, change the Display Name to Save The Map As A DWG File.

      Add the Run AutoCAD Command activity just before the LoopSaveLayers activity. Enter the command name.

    When you run the workflow, it prompts you for a location and file name for the DWG file. If you wanted to, you could specify those parameters as part of the workflow.

  4. Expand the LoopSaveLayers activity.

    This activity saves each layer in the current map as a .layer file in the specified folder

  5. Double-click the Save Layer File activity and specify a folder for the .layer files. Click OK.

    Change the output directory for the Save Layer File activity.

  6. Save the workflow.
  7. Leave the Workflow Designer open.

To continue this tutorial, go to Exercise 3: Run the workflow.