The Asset Template Macro is a System Macro which can be associated to an Asset Template. The Macro can be executed via the pop-up menu of selected Assets. The selected Assets will be passed as a parameter to the Macro. You can use this feature to add custom functionality to the Asset pop-up menu.

The Asset Template Macro is created via Macro Manager.

In Macro Manager create a new Macro. This will display the Macro Property Form;


Specify the Name and Type of the Macro. The Type of the Macro must be set to Asset Template Macro. A System Macro of this type will not lock the database and will have a predefined parameter. The Macro can perform any Macro API function but is intended to act on the selected Asset(s). Because the Macro will not lock the database you can undo the actions performed by the Macro.

 

The Macro Property Form will display the following Tabs.

 

The JScript Expression must be a script which acts on the selected Asset(s). The selected asset ID(s) can be obtained from the parameter "AssetIDs".

The parameter is defined on the Parameters Tab. You will be able to view the parameter but you cannot modify the parameter. To specify on which types of Assets users can execute the macro, go to the Custom Options Tab.

Specify the workspace in which the macro must be executed and the types of Assets the Macro must be executed on. You may also associate the macro with a specific primitive type (for example "Box") or any (All) primitive type.

Press the OK button to save the new Macro.

You will now be able to execute the Macro via the Asset's context menu;

The Macro will not expose any User Interface when it is executed. Any messages sent from the script will be ignored. Only JScript errors will be displayed in a Message Box;