Playing the Macro

A macro can be played from the workspace and stopped or, maybe more typically, can be run in batch mode. It is also possible to replay recent macros.

Running a Macro from the Workspace

To replay a macro from the workspace, select File > Macro > Play Macro from the menus.



Alternatively, click the (Play Macro) toolbar button.

This action opens the operating system-specific standard file open dialog, with the Files of Type drop-down list is automatically set to .java which allows you to select a Java macro file. Once you click Open in the dialog, Simcenter STAR-CCM+ attempts to compile the Java code, and then run it.

In addition, you can use the command line to open the Simcenter STAR-CCM+ workspace, start a new simulation, and play a macro:


% starccm+ -new -m macro.java

Progress is reported in different ways:

  • In the workspace status bar:



  • In the Output window (including any output that manual inputs generate):



If the compilation does not work, you get errors reported in a dialog and in the Output window. These errors must be corrected before the script can run.

Resolving Errors

If there are any compile errors, you receive an exception error dialog:



Click OK. You can see the error messages reported in the Output window under a new tab that is labeled Compile.



Use this information and edit the file until there are no further errors. In the example above, there is no such class called Rotor.

Stopping the Macro

You can stop the playing of a macro by clicking the (Cancel Macro) button in the workspace status bar.



Simcenter STAR-CCM+ stops the operations and shows acknowledgement by displaying an information dialog.