Share

Command line

The command line user interface within Synergy enables you to invoke Python, PowerShell, and VBScript scripts and macros.

This capability, which is dynamic and extensible, allows you to run scripts that require you to provide parameters. You can:

  • Modify existing scripts to better suit your needs, or extend them to add new capabilities
  • Add new scripts containing multiple commands, which can be used just like the built-in commands that come with Synergy.

A list of commands is displayed when you type help on the command line.

Scripts or commands can take multiple command line arguments, to provide parameters that are used when the script is running.

The name of a script is the prefix of the corresponding script file; for example, the name strintf3d refers to the strintf3d.vbs file.

Note: If scripts share the same prefix, they will be prioritized for selection in the following order: Python > PowerShell > VBScript. For example, if test.py and test.vbs are both in the commands location, test.py will be run when entering test on the command line.

You can create scripts using one of the following techniques:

  • Record a macro and save it in a commands folder. This type of script takes no command line arguments. You can then modify or extend the recorded macro to provide new capabilities or to take command line arguments.

    Note: Macros that have been modified to take command line arguments can be launched only from the command line unless the script prompts for user input.
  • Write scripts from scratch, which may or may not need parameters entered as command line arguments.

The command line will look for scripts stored in the default project directory, typically My Documents\My AMI 20XX Projects\commands. If no script is found, it will look in C:\Program Files\Autodesk\Moldflow Synergy 20XX\data\commands (where XX is the Synergy release).

Note: Not all functionality is accessible through the API. More functionality is accessible to scripts that are written by hand than to macros that are recorded from within the user interface.
Note: To ensure that Synergy does not enter Idle Mode while a script is running, disable Idle Mode when using the command line user interface.

Was this information helpful?