MET 415/425/440 Lecture Notes

Customizing Your ANSYS Tool Bar

Spring 2009


You can add frequently used ANSYS functions (or macros) to the ANSYS toolbar.

You do this by defining abbreviations. An abbreviation is simply an alias (up to eight characters long) for an ANSYS command, GUI function name, or macro name.

You can create abbreviations either through the *ABBR command or through the Utility Menu > Macro > Edit Abbreviations or Utility Menu >MenuCtrls > Edit Toolbar menu items.

The syntax for the *ABBR command and related dialogs is

*ABBR, Abbr, String

Where:
Abbr = The abbreviation name that will appear on the toolbar button. The name can contain up to eight characters.
String = The String argument is the name of the macro or command that Abbr represents. If String is the name of a macro, the macro must be within the macro search path. The string you specify can contain up to 60 characters and it can't include any of the following:

The character "$"
The commands C***, /COM, /GOPR, /NOPR, /QUIT, /UI, or *END

The default ANSYS toolbar has the following abbreviations predefined:

*ABBR, SAVE_DB, SAVE
*ABBR, RESUM_DB, RESUME
*ABBR, QUIT, Fnc_/EXIT
*ABBR, POWRGRPH, Fnc_/GRAPHICS

To delete an abbreviation (and the Toolbar button), just give the *ABBR command with the abbreviation, but with NO string argument.

If you type abbreviations into ANSYS while you are running interactively, they don't show up immediately in the toolbar. To see the new buttons, pick Utility Menu >MenuCtrls > Update Toolbar

The abbreviations (and toolbar buttons) are saved with your database file.  If you resume a database file that did not have your customized toolbar saved with it, you will see that the toolbar buttons immediately change to a different set.


Whenever you start ANSYS11.0., it reads the first "start110.ans" file it finds in the following search paths:

  1. The working directory, which may be C:\TEMP on the SoE Engr. Lab PC's
  2. Your home directory, i.e., where you are when you log in
  3. The ANSYS documentation directory

There is a "start110.ans" file in the \ANSYS\DOCU directory (supplied by ANSYS Inc. as an example).  You can copy it to your home directory and modify it.  Then, whenever you start ANSYS you will get your customized setup.

So, we put our new ToolBar buttons in the "start110.ans" file as *ABBR abbreviation commands.

For example, the "start110.ans" file might look like this:

*ABBR,RESUM_DB,        ! Delete the resume button in the default toolbar
*ABBR,REFRESH ,/replot ! program the Refresh button to do /REPLOT command
*ABBR,PL_ELEM ,eplot   ! program the PL_ELEM button to do EPLOT command
*ABBR,PL_NODE ,nplot   ! program the PL_NODE button to do NPLOT command
*ABBR,PL_KPTS ,kplot   ! program the PL_KPTS button to do KPLOT command
*ABBR,PL_LINE ,lplot   ! program the PL_LINE button to do LPLOT command
*ABBR,PL_AREA ,aplot   ! program the PL_AREA button to do APLOT command
*ABBR,PL_VOLU ,vplot   ! program the PL_VOLU button to do VPLOT command
*ABBR,PL_MULTI ,gplot   ! program the PL_MULTI button to do GPLOT command
*ABBR,NNUM_ON ,/pnum,node,1  ! Toggle node numbering ON for plots
*ABBR,NNUM_OFF,/pnum,node,0  ! Toggle node numbering OFF for plots
*ABBR,KNUM_ON ,/pnum,kp,1    ! Toggle keypoint numbering ON for plots
*ABBR,KNUM_OFF,/pnum,kp,0    ! Toggle keypoint numbering OFF for plots
*ABBR,LNUM_ON ,/pnum,line,1  ! Toggle line numbering ON for plots
*ABBR,LNUM_OFF,/pnum,line,0  ! Toggle line numbering OFF for plots
*ABBR,ANUM_ON ,/pnum,area,1  ! Toggle area numbering ON for plots
*ABBR,ANUM_OFF,/pnum,area,0  ! Toggle area numbering OFF for plots
*ABBR,EDGE_DEF ,/EDGE,1,0    ! Toggle the edge display key to default
*ABBR,EDGE_ALT ,/EDGE,1,1    ! Toggle the edge display key to alternate
*ABBR,LEGEND,/PLOPT,INFO,1   ! place the ANSYS legend on the right side
*ABBR,NUMB_OFF ,/NUM,1    ! Toggle the numbering key to OFF
*ABBR,NUMB_ON  ,/NUM,0    ! Toggle the numbering key to ON (default)
*ABBR,VW321,/view,1,3,2,1 ! create a custom view vector
*ABBR,RESUM_DB,RESUME     ! create the RESUM_DB button far away from the SAVE
*ABBR,HC_TIFF,/UI,copy,save,tiff,graph,color,reverse,portrait,yes,
*ABBR,HC_PNG,/UI,copy,save,png,graph,color,reverse,portrait,yes,
  ! *************  ! the HC_* buttons save the graphics as a TIF or PNG file