3.2.6. Create Session Files

First, it is necessary to set the name of the file to which your session commands are to be saved. This can be done by typing the CCL for the singleton object SESSION.

In the command window, type:

	SESSION:
		Session Filename = <filename>.tse
	END

To begin recording commands, type the following line into the Command Editor dialog box:

>session start [mode=<none | overwrite | append>, filename=<filename>]

To stop recording commands, type the following line into the Command Editor dialog box:

>session stop

Session files can be used to quickly reproduce all the actions performed in a previous Ansys TurboGrid Session. Session files can be generated manually using a text editor, or from within Ansys TurboGrid by recording a session. The commands required to write to these files from the Command Editor dialog box are described below. The >session command handles all Write Session features.

The following options are available to support the functionality:

>session start supports the following options:

  • mode = <none | overwrite | append>

    If mode is set to none (the default value), an error is raised if the file already exists. If mode is set to overwrite, the file is deleted and newly created if it already exists. If mode is set to append, the new session is appended to the end of the existing file.

  • filename = <filename>

    Specifies the filename and path to the session file. If no filename is specified, the SESSION singleton indicates the filename and the mode to use for overwriting/appending. If no SESSION singleton exists, an error is raised indicating that a filename must be specified.

The session stop command terminates the saving of a session, and closes the session file. No options are accepted with this option.

3.2.6.1. session Command Examples

The following are example >session commands, and the expected results. If a SESSION singleton exists, the values of the parameters listed after the >session command replace the values stored in the SESSION singleton object. For this command, the filename parameter value replaces the session filename parameter value in the SESSION singleton, and the mode command parameter value replaces the write session mode parameter value in the SESSION singleton.

> session start, filename = mysession.tse

This action starts a new session in a filename called mysession.tse. If mysession.tse already exists, the overwrite/append behavior is dependent on that set in the SESSION singleton. If no SESSION singleton exists, and the mysession.tse file also exists, the command fails with an error message (that is, default mode is none).

> session start, mode = none, filename = mysession.tse

This command starts a new session file in a filename called mysession.tse. If mysession.tse already exists, the command fails with an error message.

> session start, mode = overwrite, filename = mysession.tse

This command starts a new session. If mysession.tse already exists it is deleted, and replaced with the new session. If the file does not already exist, it is created.

> session start, mode = append, filename = mysession.tse

This command starts a new session. If mysession.tse already exists, the new session is appended to the end of the existing file. If the file does not already exist, it is created.

> session start

This command starts a new session, using the mode and filename defined in the SESSION singleton. If the SESSION singleton does not exist, an error message is raised indicating that a filename must be specified.

> session start, mode = overwrite

This command starts a new session with a filename of that specified in the SESSION singleton. If the specified file already exists, it is deleted and a new file is created. If the SESSION singleton does not exist, an error message is raised indicating that a filename must be specified.

> session start, mode = append

This command starts a new session with a filename of that specified in the SESSION singleton. If the specified file already exists, the new session is appended to the end of the existing file. If the SESSION singleton does not exist, an error message is raised indicating that a filename must be specified.

> session start, mode = none

This command starts a new session with a filename of that specified in the SESSION singleton. If the specified file already exists, the command is terminated with an error message. If the SESSION singleton does not exist, an error message is raised indicating that a filename must be specified.

> session stop

This command terminates the current session in progress, and closes the currently open session file.