www.kxcad.net Home > CAE Index > ANSYS Index > Release 11.0 Documentation for ANSYS
By including the *ASK command within a macro, you can have the macro prompt a user to type in a parameter value.
The format for the *ASK command is
*ASK,Par,Query,DVAL
Where
Par is an alphanumeric name that identifies the scalar parameter used to store the user input.
Query is the text string that ANSYS displays to prompt the user. This string can contain up to 54 characters. Don't use characters that have special meanings, such as "$" or "!".
DVAL is the default value given the parameter if a user issues a blank response. This value can be either a one-to-eight character string (enclosed in single quotes) or a number. If you assign no default, a blank user response deletes the parameter.
The *ASK command prints the Query text on the screen and waits for a response. It reads the response from the keyboard except when ANSYS runs in batch mode. (In that case, the response or responses must be the next-read input line or lines.) The response can be a number, a one-to-eight character string enclosed in single quotes, a numeric or character parameter, or an expression that evaluates to a number. ANSYS then sets the value of Par to the read-in response. The following example displays the dialog box shown below, then sets the parameter PARM1 to the value the user enters.
*ask,parm1,'username (enclose the username in single quotes)'
When you issue *ASK within a macro, ANSYS writes the user's response to File.LOG on the line following the macro name.