2.24. Using Macros

The Mechanical application enables you to execute custom functionality that is not included in a standard Mechanical application menu entry via its Scripting feature. The functionality is defined in a macro - a script that accesses the Mechanical application programming interface (API).

Macros can be written in the Python (.py) programming language. For additional information, refer to the Script Examples section of the Scripting in Mechanical Quick Start Guide. Macros cannot currently be recorded from the Mechanical application.

To access a macro from the Mechanical application:

  1. Choose Scripting option from the Support group on the Automation tab.

  2. Navigate to the directory containing the macro.

  3. Select the macro.


Note:  Note: For the current release. Mechanical also supports macros written in the legacy languages Microsoft's JScript and VBScript. Several macro files are provided with the Ansys Workbench installation under \ANSYS Inc\v190\aisol\DesignSpace\DSPages\macros.