Macro Files
Macro files (with the file extension of either *.TCM
or *.LOG
) are plain text files used to save a sequence of commands that can be loaded and executed. Macro files can be edited in a text editor. When creating a command sequence, you add comments to the file by starting a line with @@.
Macro files include comments, which you can either run in Thermo‑Calc or open and read in a text editor.
If you only open and read the macro file in a text editor, you do not see the output that Thermo‑Calc gives in response to the commands stored in the macro file. It is recommended you run the macro to view all the details.

To open a Thermo‑Calc example macro file:
- Open Thermo‑Calc.
- Confirm you are in Console Mode. If not, click the Switch to Console Mode button.
- From the main menu, select File → or Help → Examples Files. The Console Mode folder opens.
- Open the Thermo‑Calc folder to see the available examples contained in separate folders.
For the Diffusion Module (DICTRA) examples (*.DCM
macro files), open the Diffusion Module - DICTRA folder.
- In the folder, double-click the *.
TCM
file or click Open. - Follow the prompts in the Console window i.e. keep pressing <Enter> to run the macro and produce a plot in the Console Results window.

Action | Command | Description and Comments |
---|---|---|
To load a macro file |
In the SYS module, MACRO_FILE_OPEN followed by the name of the macro file. |
Thermo‑Calc starts the command sequence that the file contains. |
Regain control of the console |
End a macro file with this command to have control of the Console returned to you. |
|
Add comments to a macro file |
Start a line with @@, or enclose it between an @ (-line and a @)-line. |
When lines are enclosed the software ignores them when running the macro. |
Open a macro file |
MACRO_FILE_OPEN |
When creating the log file, you can make a macro file load up to five other macro files. |
Nest macro files inside of each other |
MACRO_FILE_OPEN SET_INTERACTIVE |
If a nested macro file ends with SET_INTERACTIVE, then Thermo‑Calc resumes with the higher-level macro file at the command immediately following the MACRO_FILE_OPEN command that loaded and executed macro file that has just been terminated. If a nested macro file doesn’t end with SET_INTERACTIVE (but with an end-of-file character), then the console shuts down and the macro is stopped. |

The @?
character allows you to make a macro interactive by allowing input. At the @? character, which is placed where a parameter value or argument is normally put, Thermo‑Calc prompts to input the value of a parameter or argument. You can enter a string immediately following the @? character. This string is presented to the user when prompted to enter the parameter value or argument. The entered value is used by Thermo‑Calc as input to the command in question. For example, you can request the user to specify the temperature range of a stepping calculation by entering the following in a macro file:
SET_AXIS_VARIABLE 1 T @?Low-temperature-limit: @?High-temperature-limit:
You can also use up to nine variables in your macro file and prompt the user to enter values that can be assigned to these variables. Use the @#n
character when you want to prompt the user to provide a value to the variable, where the n is a digit between 1
and 9
. You can then use this value by with the ##n
character. For example, you can request the user to provide the first element of a system by entering the following in the macro file:
@#3First-element?
You can then use this variable with the entering the character ##3 later in the macro file. For example, you can write:
SET_AXIS_VARIABLE 1 x(##3) 0 1,,,
Finally, there is the @&
pause character. Thermo‑Calc pauses and waits for input from the user when this pause character is read from a macro file. Inserting pause characters is useful if you want to allow the user to monitor what is happening when Thermo‑Calc is running the macro.

Macro files that are created while you use a response-driven module begin with the module-entering command (for example, Goto_Module Scheil)
followed by a number of lines with responses to the module’s questions and requests. The file terminates with the commands POST or SET_INTERACTIVE (this command gives you back control of the Console). An empty line cannot be edited with any input rather than the default answer (to a specific question). Comment lines, commands to open other macro files, pause characters or input-controlling characters cannot be inserted between these empty lines (otherwise the response-driven module cannot be executed properly).