Action Strings
The actions that the product performs when you select a tool, select a menu item, or press a function key are defined by the action string associated with that object. At first it is simplest to think of an action string as a key-in or series of key-ins. For example, the action string associated with the Place SmartLine tool is the key-in PLACE SMARTLINE. The true effect of selecting the Place SmartLine tool is activation of the PLACE SMARTLINE key-in.
Action Types
Several types of actions can be specified in action strings and associated with tools, view controls, menu items, and function keys.
Action type | Syntax | Description |
---|---|---|
Command Entry Key-in | E,<key-in> | Simulates a key-in. The key-in specified by a command entry key-in is always activated, regardless of state of the active key-in. For example, suppose that PLACE CIRCLE RADIUS is the active key-in and is prompting for the radius. If you press a function key defined in the function key menu to have action type E that activates the PLACE LINE CONSTRAINED key-in, then PLACE LINE CONSTRAINED becomes the active key-in. |
Terminated Key-in | T,<key-in> | Simulates a key-in. A terminated key-in is normally used to get data requested by prompts, such as the radius of a circle, text, or an answer to a yes-or-no question. |
Unterminated Key-in | K,<key-in> | Keys in an unterminated string of characters and waits for you to finish the string. |
Print Message | M,<message> | Prints a message in one of the status bar fields. |
Action Type Options
These options can be used immediately following the E, T, or K action types or anywhere in a multiple action string following a semicolon.
Entering Multiple Action Strings
Each action string can contain several actions (separated by semicolons).
For example, this action string places a blue two-inch circle at a user-specified point: co=blue;E,PLACE CIRCLE RADIUS;T,2;M,cfPlace 2 Inch Circle;%d;null
The actions are as follows:
Action | Description |
---|---|
co=blue | A command entry key-in (since no type is specified) that sets the Active Color to blue. The product activates the ACTIVE COLOR key-in even if it currently expects a data key-in. |
E,PLACE CIRCLE RADIUS | The key-in PLACE CIRCLE RADIUS. |
T,2 | A terminated key-in that enters a radius of 2. |
M,cfPlace 2 Inch Circle | Displays the message "Place 2 Inch Circle" in the status bar. |
%d | Waits for a data point without displaying the normal prompts (preserving the prompt displayed by the previous action). |
null | After the circle is placed, executes the NULL key-in so that no tool or view control is selected. |