Share

Creating a Python script

The Synergy command line provides you with access to run Python scripts within Synergy.

Macros recorded in Synergy will use the Moldflow Python package to interface with the Moldflow API. To read more about the Moldflow Python package, see the github documentation.

You can use any text editor to create scripts; some Python editors have built-in debuggers to highlight incorrect code. You can write scripts to use parameters that are entered by the user as command line arguments in the Synergy command line.

Note: Not all functionality is accessible using the API. More functionality is accessible to scripts written by hand and run from the command line, than to macros that are recorded and run from the interface.

To run macros or scripts in the Synergy command line:

  1. Record a macro or type your script into a text editor or Python editor/IDE.
  2. Save the macro or script to a file with a *.py extension in MyDocuments\My AMI 20XX Projects\commands where XX is the Synergy release number.

The script can be played from the Command Line (View tab > Windows panel > User Interface > Command Line) or from the Play Macro button (Tools tab > Automation panel > Play Macro).

Was this information helpful?