Fundamentals > Creo Parametric User Interface > The File Menu > Working with Trail and Training Files > Directives for Creating Training Files and Trainer Text Files
  
Directives for Creating Training Files and Trainer Text Files
The following directives are available to create training files and trainer text files. The directives are listed in alphabetical order.
 
* You must include the open single quote ( ` ) preceding the directive.
Breakpoint
Syntax
`breakpoint
Description
Stops the rapid execution of the training file and returns the trainee to single-stepping. Add this directive after the menu selection at which you want to break.
Cont At
Syntax
`cont_at<label_name>
Description
Causes the training file to skip all commands and statements until the specified label is found. Execution continues from that point on. The argument label_name can point to a label further ahead in the training file, but cannot point back.
Example
`cont_at get_out
Transfers training file execution to the label get_out.
See Also
Marker Name
Display Menu
Syntax
`display_menu menu_name
Description
Displays a menu that has already been defined with a `menu_options command. For the item selected, the action specified in the `menu_options command is performed.
Example
`display_menuchoices
Displays the menu named choices. It is assumed that the menu has already been defined with the `menu_options command.
See Also
Menu Options
File
Syntax
`filename
Description
Specifies the trainer's text file to be used with the training file.
Only one such file can be specified; subsequent `file commands have no effect.
You must enter the full path name only if the text file is not in the same directory (path names can contain up to 260 characters). If there is no path specified with the name, the system searches for the file in the following directories, in order:
The current directory
The directory in which the training file resides
The training directory, if defined in the config.pro file with the TRAIN_PATH_FILE configuration option
Example
`file text.txt
The file text.txt is associated with the training file.
`file /usr/users/train/text.txt
The file text.txt, located in the directory /usr/users/train, is associated with the training file.
Graphics Resume
Syntax
`graphics_resume
Description
Restores the graphics mode after a `graphics_stop command. If the system does not encounter a previous `graphics_stop command, nothing happens.
See Also
Graphics Stop
Graphics Stop
Syntax
`graphics_stop
Description
Stops putting new graphics on the screen. This command can be used to conceal a particular sequence of operations from the trainee.
You can execute all the commands in the trail file between this directive and `graphics_resume, but they are not displayed on the screen. The geometry that is displayed in the main window is frozen at the point before the command preceding the `graphics_stop directive. The menus are not displayed. When the trail file reaches the directive `graphics_resume, the system resumes normal geometry and menus are displayed.
Example
See Also
Graphics Resume
Ignore
Syntax
`ignore
Description
Can be used in other commands to replace an action or argument. If an action is replaced, the system does nothing. If an argument is replaced, the system uses a default value.
Example
`menu_options choices continue `ignore `ignore skip `cont_at dome_feature
Marker Name
Syntax
`marker label_name
Description
Defines a label in the training file, which can then be referenced as a target for a jump.
Example
`marker get_out
Defines a label called get_out in the training file.
See Also
Cont At
Menu Options
Syntax
`menu_options menu_nameitem 1_name action1 {arg1} {item2_name action2 {arg2}...}
Description
Allows you to define a menu to be displayed to the trainee when running the training file. The argument menu_name is the name by which the menu is identified.
The menu can have any number of items. Each item definition must have an action command and an argument, if necessary. You can use `ignore for both actions and arguments.
The number of characters in menu_name and any of its items cannot exceed 20.
Example
`menu_options choices quit `cont_at get_out continue `ignore `ignore skip `cont_at dome_feature.
See Also
Marker Name
Nostop Typefile
Syntax
`nostop_typefile
Description
Returns the control of the INFORMATION WINDOW display to Creo Parametric after the ``stop_typefile command. If no previous `stop_typefile command has been encountered, nothing happens.
Example
`nostop_typefile
The INFORMATION WINDOW (other than the window with the trainer's text) scrolls quickly.
See Also
Stop Typefile
Pause
Syntax
`pause line number
Description
Stops the execution of the training file until you click Resume to continue the execution of the training file again.
Example
`pause 74
Prompt
Syntax
`prompt number
Description
Displays a prompt message in the Message Window. The number argument is the number of blocks in the trainer's text file.
Example
`prompt 77
Displays the first line of text block number 77 in the associated text file in the Message Window.
See Also
File
Text
Set Window Output
Syntax
`set_window_output
Description
Restores regular training file operations for message output.
See Also
Unset Window Output
Stop Typefile
Syntax
`stop_typfile
Description
Passes the control of the INFORMATION WINDOW display to the trainee, providing the ability to page back and forth, and so on.
When the training file runs, Creo Parametric information (such as the feature's information and mass properties calculations) is displayed in the INFORMATION WINDOW. If there are multiple pages in the messages in the INFORMATION WINDOW, they scroll by quickly, and there is no time to view them. This directive allows the trainee to control the display.
This command does not affect the display of trainer's text. To switch this command off, use the `nostop_typefile command.
See Also
Nostop Typefile
Text
Syntax
`text<number>
Description
Specifies which block of the text file is to be displayed in the INFORMATION WINDOW at a specified interval when running the training file. Add this directive after the menu pick at which you want to break.
Any text block can be displayed at any time, in any order. Repetitive block displays are also allowed.
Example
`text 44
Displays text block number 44.
Textwindow Hints
Syntax
`textwindow_hints {px py} {rows cols}
Description
Allows you to change the size and position of the INFORMATION WINDOW with the trainer's text. In the syntax, px and py represent horizontal and vertical positioning of the text window (its lower-left corner), with respect to the main window. The argument rows specifies the number of rows in the text window, and cols specifies the number of columns in the text window.
You can omit any pair of parameters, in which case the system defaults are used. (To omit the first pair, replace it with two `ignore commands.) If any parameter is out of range, the system uses the default values. The table Command Parameters lists the system defaults and valid ranges for the parameters.
Example
`textwindow_hints 0.1 0.1 8 80
The INFORMATION WINDOW size will be 8 rows by 80 columns. Its origin will be offset at 0.1, 0.1 with respect to the main window.
`textwindow_hints `ignore `ignore 30 70
In this example, only the window size is specified (30 rows by 70 columns). The INFORMATION WINDOW origin will be at the default location.
See Also
Ignore
Unset Window Output
Syntax
`unset_window_output
Description
Removes the Text INFORMATION WINDOW and diverts all message output to the Message window.
See Also
Set Window Output
User Input
Syntax
`user_input keyboard_data {fail} {succ} {giveup} {retries}
Description
Forces the trainee to enter some keyboard data at some point while running the training file.
The arguments are as follows:
keyboard_data—The keyboard data line duplicated from the training file.
fail—The message to be displayed if the user fails to enter the expected data. The format is that of a `text command. Only the first line of the specified text block is displayed. If you replace this argument with `ignore, the default message is displayed.
succ—The message to be displayed if the user succeeds in entering the expected data. The format is that of a `text command. Only the first line of the specified text block is displayed. If you replace this argument with `ignore, the default message is displayed.
giveup—The message to be displayed if the user fails the maximum allowed number of retries, which is specified by the argument retries. The format is that of a `text command. Only the first line of the specified text block is displayed. If you replace this argument with `ignore, the default message is displayed.
retries—The maximum number of attempts allowed. If you do not specify this argument, or replace it with ignore, the system uses the default value (5).
The `user_input command line is a duplicate, not a replacement, of an existing line with keyboard data in the training file. To compose this command, copy a keyboard data line, and add the `user_input command prefix. Place the command above the actual keyboard data line.
Example
`user_input 0.5
0.5
This example shows the basic `user_input command that uses the default message specifiers. The second line is the actual trail file line.
``user_input 0.5 'text 67 `ignore `ignore 20.5
This example defines the failure message (as the first line of block number 67 in the associated text file), and allows two tries. The second line is the actual trail file line.
See Also
Ignore
User Menu Pick
User Pick
User Menu Pick
Syntax
`user_menu_pick command {fail} {succ} {giveup} {retries}
Description
Forces the trainee to perform a menu pick at some point while running the training file.
The arguments are as follows:
command—The menu command line duplicated from the training file. The # character is retained.
fail—The message to be displayed if the user fails to make the expected menu pick. The format is that of a `text command. Only the first line of the specified text block is displayed. If you replace this argument with `ignore, the default message is displayed.
succ—The message to be displayed if the user succeeds in making the expected menu pick. The format is that of a `text command. Only the first line of the specified text block is displayed. If you replace this argument with `ignore, the default message is displayed.
giveup—The message to be displayed if the user fails the maximum allowed number of retries, which is specified by the next argument. The format is that of a `text command. Only the first line of the specified text block is displayed. If you replace this argument with `ignore, the default message is displayed.
retries—The maximum number of attempts allowed. If you do not specify this argument, or replace it with ignore, the system uses the default value (5).
The `user_menu_pick command line is a duplicate, not a replacement, of an existing menu pick line in the training file. To compose this command, copy a menu pick line and add the command prefix `user_menu_pick. Place the command above the actual menu pick line.
 
* This function is available for standard Creo Parametric options only, not user-defined options (which are defined using the functions Menu Options and Display Menu).
Example
`user_menu_pick #DIMENSION
#DIMENSION
This example shows the basic `user_menu_pick command that uses all the default message specifiers. The second line is the actual trail file line.
`user_menu_pick #REGENERATE `ignore `text 78`ignore 3 #REGENERATE
This example defines the success message (as the first line of block number 78 in the associated text file), and allows three retries. The second line is the actual trail file line.
See Also
Ignore
User Input
User Pick
User Pick
Syntax
`user_pick x y b {fail} {succ} {giveup} {retries}
Description
Forces the trainee to perform a graphics pick at some point while running the training file.
The arguments are as follows:
x, y, b—The XY coordinates and button code of a pick duplicated from the training file.
fail—The message to be displayed if the user fails to make the expected pick. The format is that of a `text command. Only the first line of the specified text block is displayed. If you replace this argument with `ignore, the default message is displayed.
succ—The message to be displayed if the user succeeds in making the expected pick. The format is that of a `text command. Only the first line of the specified text block is displayed. If you replace this argument with `ignore, the default message is displayed.
giveup—The message to be displayed if the user fails the maximum allowed number of retries, which is specified by the next argument. The format is that of a `text command. Only the first line of the specified text block is displayed. If you replace this argument with `ignore, the default message is displayed.
retries—The maximum number of attempts allowed. If you do not specify this argument, or replace it with `ignore, the system uses the default value (5).
The `user_pick command line is a duplicate, not a replacement, of an existing pick in the training file. To compose this command, copy a pick line, and add the `user_pick command prefix. Place the command above the actual pick line.
Example
`user_pick 0.427022 0.495110 L 0.427022 0.495110 L
This example shows the basic `user_pick command, with all the default message specifiers. The second line is the actual trail file line.
`user_pick 0.427022 0.495110 L `text 43 `ignore `ignore 15 0.427022 0.495110 L
This example defines the failure message (as the first line of block number 43 in the associated text file), and allows fifteen retries. The second line is the actual trail file line.
See Also
Ignore
User Menu Pick