An Activity is an action that can be executed in Design Automation.
-
On the Postman sidebar, click Task 4 - Publish an Activity > POST Create a New Activity. The request loads.
-
Click the Body tab. Observe the body parameters.
Notes:
-
id
is the name given to the new Activity. The id is picked up from the Postman Environment VariabledasActivityName
. -
commandLine
is the command run by this Activity. It consists of several variables. These variables are replaced by actual values at the time the Activity is executed. This mechanism provides the ability to test the command line locally with file paths that are applicable to Design Automation. For more information, see the documentation on command lines.-
$(engine.path)\\accoreconsole.exe
- The full path to the AutoCAD engine. The version of AutoCAD to be used is defined in the request body as"engine": "Autodesk.AutoCAD+22"
. -
$(args[InputDwg].path)
- The full path to the folder that the file identified by the parameterInputDwg
(by the WorkItem that invokes this Activity) is downloaded to. -
$(appbundles[{{dasAppBundleName}}].path)
identifies the path to where the specified AppBundle is unzipped to. The AppBundle is specified in the request body as"appbundles": [ "{{dasNickName}}.{{dasAppBundleName}}+{{dasAppBundleAlias}}"]
. Note the use of Postman Variables to specify the Nickname, AppBundle Id, and the AppBundle version alias. -
$ (settings[script].path
identifies the path to the file where Design Automation saves the value of the setting namedscript
. See AutoCAD documentation on Command Scripts for information on writing scripts.
-
-
parameters
defines the inputs and outputs that need to be provided when the Activity is executed. Input parameters are identified by the attribute"verb":"get"
. Output parameters are identified by the attribute"verb":"put"
. -
engine
is the Design Automation engine that the Activity (AutoCAD 2020 in this case) runs on. -
settings
specifies the command script to be run by the activity. In this case, it calls the custom command TEST.
-
Set the
dasActivityName
Postman Variable toListLayerActivity
.-
Click the Environment quick look icon on the upper right corner of Postman.
-
In the CURRENT VALUE column, in the dasActivityName row, enter ListLayerActivity.
-
Click the Environment quick look icon again.
-
-
Click Send. If the request is successful, you should see a screen similar to the following image.
When you created an Activity earlier, you created version 1 of the Activity. You can create new versions of the Activity and make improvements with time. The id
of an Activity alone is not sufficient to define which version of an Activity Design Automation must execute. You use an Alias for this purpose. You can think of an Alias as a tag that points to a particular version of an Activity. The version that an Alias points to can be changed as you develop more versions of a given Activity.
To create an alias named my_current_version
, which refers to version 1
of the ListLayersActivity
:
-
On the Postman sidebar, click Task 4 - Create an Activity > POST Create an Alias to the Activity. The request loads.
-
Click the Body tab, and observe how the alias id has been set to
my_current_version
. -
Click Send. If the request is successful, you should see a screen similar to the following image.