Sie sind auf Seite 1von 3

4/26/2016

APDL:Chapter2:AddingCommandstotheToolbar(UP19980820)

Chapter2:AddingCommandstotheToolbar
GototheNextChapter
GotothePreviousChapter
GototheTableofContentsforThisManual.
Chapter1*Chapter2*Chapter3*Chapter4*Chapter5*Chapter6
YoucanaddfrequentlyusedANSYSfunctionsormacrostotheANSYStoolbar(creatingmacrosis
coveredstartinginSection4.1).Youdothisbydefiningabbreviations.Anabbreviationissimplyan
alias(uptoeightcharacterslong)foranANSYScommand,GUIfunctionname,ormacroname.For
example,MATPROPmightbeanabbreviationforamacrothatlistsmaterialproperties,SAVE_DBis
anabbreviationfortheSAVEcommand,andQUITisanabbreviationfortheFnc_/EXITfunction
(whichlaunchesthe"ExitfromANSYS"dialogbox).
TheANSYSprogramprovidestwowaystouseabbreviations.Youcanissuetheabbreviation(and
executethemacro,command,etc.thatitperforms)bytypingitatthebeginningofacommandline.
Or,ifyou'reusingtheANSYSGUI,youcanexecutethemacroorcommandbypressingthe
appropriatebuttonontheANSYStoolbar.
Thetoolbar,showninthefollowingfigure,containsbuttonsthatcorrespondtoexistingabbreviations.
Figure21TheANSYSToolbarShowingtheDefaultButtons.

Whilesomeabbreviations,suchasSAVE_DB,arepredefined,theabbreviationsthetoolbarcontains
andthefunctionstheyexecuteareuptoyou.Asingletoolbarcanholdupto100abbreviations(you
can"nest"toolbarstoextendthisnumber).Youcanredefineordeleteabbreviationsatwillhowever,
abbreviationsarenotautomaticallysavedandmustbeexplictlysavedtoafileandreloadedforeach
ANSYSsession.

2.1ModifyingtheToolbar
Youcancreateabbreviationseitherthroughthe*ABBRcommandorthroughtheUtilityMenu>
Macro>EditAbbreviationsorUtilityMenu>MenuCtrls>EditToolbarmenuitems.Usingone
ofthemenuitemsispreferablefortworeasons:
ClickingOKautomaticallyupdatesthetoolbar(usingthe*ABBRcommandrequiresthatyou
usetheUtilityMenu>MenuCtrls>UpdateToolbarmenuitemtomakeyournew
abbreviationappearonthetoolbar).
Youcaneasilyedittheabbreviationifrequired.
Thesyntaxforthe*ABBRcommandandrelateddialogsis
*ABBR,Abbr,String
Where
http://www.ansys.stuba.sk/html/prog_55/gapdl/AS2.htm

1/3

4/26/2016

APDL:Chapter2:AddingCommandstotheToolbar(UP19980820)

Abbr
Theabbreviationnamethatwillappearonthetoolbarbutton.Thenamecancontainuptoeight
characters.
String
TheStringargumentisthenameofthemacroorcommandthatAbbrrepresents.IfStringisthe
nameofamacro,themacromustbewithinthemacrosearchpath.Formoreinformationabout
usingmacros,seeSection4.1.IfStringreferencesanANSYSpickingmenuordialogbox
(usingUIDL),thenspecify"Fnc_string."Forexample,intheabbreviationdefinitionsfor
"QUIT,""POWRGRPH,"and"ANSYSWEB"shownabove,"Fnc_/QUIT,"
"Fnc_/GRAPHICS,"and"Fnc_HomePage"arealluniqueUIDLfunctionnameswhichidentify
theANSYSpickingmenuordialogboxassociatedwiththeQUIT,POWRGRPH,and
ANSYSWEBabbreviationsrespectively.FormoreinformationaboutaccessingUIDL
functions,seeSection5.6.Thestringyouspecifycancontainupto60charactersanditcan't
includeanyofthefollowing:
Thecharacter"$"
ThecommandsC***,/COM,/GOPR,/NOPR,/QUIT,/UI,or*END
ThedefaultANSYStoolbarhasthefollowingabbreviationspredefined:
*ABBR,SAVE_DB,SAVE
*ABBR,RESUM_DB,RESUME
*ABBR,QUIT,Fnc_/EXIT
*ABBR,POWRGRPH,Fnc_/GRAPHICS
*ABBR,ANSYSWEB,Fnc_HomePage

Forexample,toaddabuttontothetoolbarthatcallsthemacrofilemymacro.mac,youwouldenter
thevaluesshowninthefollowingfigureintheUtilityMenu>MenuCtrls>EditToolbardialog
box.
Figure22AddingaNewAbbreviation.

Thenewbuttonisappendedtothebuttonbarasshowninthefollowingfigure.
Figure23TheButtonfortheNewAbbreviation.

http://www.ansys.stuba.sk/html/prog_55/gapdl/AS2.htm

2/3

4/26/2016

APDL:Chapter2:AddingCommandstotheToolbar(UP19980820)

ToolbarbuttonsarenotpersistentfromoneANSYSsessiontothenexthowever,theyaresavedand
maintainedinthedatabasesothatany"resume"ofthesessionwillstillcontaintheseabbreviations.
Tosaveyourcustombuttondefinitions,youmustexplicitlysavethemtoafilethroughtheUtility
Menu>MenuCtrls>SaveToolbarmenuitem(*ABBSAVcommand)andrestorethemforeach
sessionusingtheUtilityMenu>MenuCtrls>RestoreToolbarmenuitem(*ABBREScommand).
Youcandothisprogrammaticallyinamacro.
NoteIfanyabbreviationsalreadyexistinthenamedfile,the*ABBSAVcommandoverwritesthem.
TheformatoftheabbreviationsfileissimplytheAPDLcommandsthatareusedtocreatethe
abbreviations.Thus,ifyouwishtoeditalargesetofbuttonsorchangetheirorder,youmayfindusing
atexteditortobethemostconvenientmethod.Forexample,thefollowingisthefilethatresultsfrom
savingthedefaulttoolbarbuttons.
/NOPR
*ABB,SAVE_DB,SAVE
*ABB,RESUM_DB,RESUME
*ABB,QUIT,Fnc_/EXIT
*ABB,POWRGRPH,Fnc_/GRAPHICS
*ABB,ANSYSWEB,Fnc_HomePage
/GO

The*ABBcommands(theabbreviatedformof*ABBR)definethebuttons.The/NOPRatthetop
turnsoffechoingtothelogfilewhilethe/GOatthebottomturnslogfileechoingon.

2.2NestingToolbarAbbreviations
Thesaveandrestorefeaturesdescribedaboveallowyoutonestabbreviations.Bynesting
abbreviationsunderonebutton,youcandefinespecializedtoolbars(ifyouhavemanyabbreviations,
havingthemonasingletoolbarcanbecluttered,makingitdifficulttofindtheproperbutton).Tonest
abbreviations,yousimplydefineanabbreviationthatrestoresanabbreviationfile.Forexample,the
followingcommanddefinesPREP_ABRasanabbreviationthatrestoresabbreviationsfromthefile
prep.abbr.
*ABBR,PREP_ABR,ABBRES,,PREP,ABBR

PREP_ABRwillappearasabuttononthetoolbar.Clickingitwillreplacetheexistingbuttonswith
thesetofbuttonsdefinedintheprep.abbrfile.
Bydefiningabbreviationstorestorethesefilesandincludingthoseabbreviationsintheappropriate
files,youcanhaveavirtuallyunlimitednumberofabbreviationsinagivenANSYSsession.Youcan
evenextendthisconceptandcreateyourownmenuhierarchybynestingseveralabbreviationfiles.If
youimplementsuchahierarchy,it'sagoodpracticetoaddanabbreviationasa"return"buttonineach
filetonavigatebackthroughthemenus.
Gotothebeginningofthischapter

http://www.ansys.stuba.sk/html/prog_55/gapdl/AS2.htm

3/3