5.2. Prompting Users With a Dialog Box

www.kxcad.net Home > CAE Index > ANSYS Index > Release 11.0 Documentation for ANSYS


Your Ad Here

The MULTIPRO command constructs a simple, multiple-prompt dialog box that can contain up to 10 parameter prompts. The command allows you to use a set of UIDL *CSET commands to create the prompts as well as specify a default value for each prompt. Be aware that macros using MULTIPRO cannot be called from UIDL. You cannot use MULTIPRO within a DO loop.

The MULTIPRO command must be used in conjunction with:

The command has the following syntax:

MULTIPRO,'start',Prompt_Num 
*CSET,Strt_Loc,End_Loc,Param_Name,'Prompt_String',Def_Value 
MULTIPRO,'end'

Where

'start'

A literal string that, when encountered as the first argument, marks the beginning of the MULTIPRO construct. The literal must be enclosed in single quotes.

Prompt_Num

Required only if Def_Value is omitted from at least one *CSET command or if Def_Value is set to 0. The Prompt_Num value is an integer equal to the number of following *CSET prompts.

Strt_Loc,End_Loc

The initial value for Strt_Loc for the first *CSET command is 1, and the value for End_Loc is Strt_Loc+2 (3 for the first *CSET command). The value of each subsequent Strt_Loc is the previous End_Loc+1.

Param_Name

The name of the parameter that will hold either the value specified by the user or, if the user supplies no value, the value of Def_Value .

''Prompt_String''

A string, which can contain up to 32 characters, which can be used to describe the parameter. This string must be enclosed in single quotes.

Def_Value

Default value used if no value specified by user. Default value can be a numeric expression including APDL numeric parameters. Character expressions are not allowed.

'end'

A literal string, used as the first argument for the closing MULTIPRO command.

The following is a typical example of the MULTIPRO command.

multipro,'start',3
    *cset,1,3,beamW,'Enter the overall beam width',12.5
    *cset,4,6,beamH,'Enter the beam height',23.345
    *cset,7,9,beamL,'Enter the beam length',50.0
multipro,'end'

Up to two optional *CSET commands can be added to the construct that can provide two 64 character strings. You can use these to provide instructions to the user. The syntax for these specialized *CSET commands is

*CSET,61,62,'Help_String','Help_String'*CSET,63,64,'Help_String','Help_String'

Where

'Help_String'

A string which can contain up to 32 characters. If you need more than 32 characters, you can use a second Help_String argument.

The following is an example of a MULTIPRO construct using the optional help lines. Note that two Help_String arguments are used to overcome the 32 character limit.

multipro,'start',3
    *cset,1,3,dx,'Enter DX Value',0.0
    *cset,4,6,dy,'Enter DY Value',0.0
    *cset,7,9,dz,'Enter DZ Value',0.0
    *cset,61,62,'The MYOFSET macro offsets the',' selected nodes along each'
    *cset,63,64,'of the three axes.  Fill in the ',' fields accordingly.'
multipro,'end'

The above construct creates the following multiple-prompt dialog box.

Figure 5.2  A Typical Multiple-Prompt Dialog Box

You can check the status of the buttons by testing the value of the _BUTTON parameter. The following lists the button status values:

At present, the Help button is not functional.

Your Ad Here