www.kxcad.net Home > CAE Index > ANSYS Index > Release 11.0 Documentation for ANSYS
Within macros, you can insert commands to define an ANSYS dialog box containing a status bar displaying the progress of an operation, a STOP button you can click on to stop the operation, or both.
To define a status dialog box, issue the following command:
*ABSET,Title40,Item
Title40 is the text string that appears in the dialog box with the status bar. The string can contain a maximum of 40 characters.
Item is one of the following values:
To update the status bar, issue the command *ABCHECK,Percent,NewTitle.
Percent is an integer between 0 and 100. It gives the position of the status bar.
NewTitle is a 40-character string that contains progress information. If you specify a string for NewTitle, it replaces the string supplied in Title40.
If you specify KILL or BOTH, your macro should check the _RETURN parameter after each execution of *ABCHECK to see if the user has pressed the STOP button, then take the appropriate action.
To remove the status bar from the ANSYS GUI, issue the *ABFINI command.
The following example macro illustrates the status bar (complete with bar and STOP button) in use. The status dialog box that is produced is shown in the following figure. Note that the macro checks the status of the _RETURN parameter and, if the STOP button is pressed, posts the "We are stopped......" message.
fini
/clear,nost
/prep7
n,1,1
n,1000,1000
fill
*abset,'This is a Status Bar',BOTH
myparam = 0
*do,i,1,20
j = 5*i
*abcheck,j
*if,_return,gt,0,then
myparam = 1
*endif
*if,myparam,gt,0,exit
/ang,,j
nplot,1
*if,_return,gt,0,then
myparam = 1
*endif
*if,myparam,gt,0,exit
nlist,all
*if,_return,gt,0,then
myparam = 1
*endif
*if,myparam,gt,0,exit
*enddo
*if,myparam,gt,0,then
*msg,ui
We are stopped.........
*endif
*abfinish
fini