4/26/2016
APDL:Chapter2:AddingCommandstotheToolbar(UP19980820)
Chapter2:AddingCommandstotheToolbar
GototheNextChapter
GotothePreviousChapter
GototheTableofContentsforThisManual.
Chapter1*Chapter2*Chapter3*Chapter4*Chapter5*Chapter6
YoucanaddfrequentlyusedANSYSfunctionsormacrostotheANSYStoolbar(creatingmacrosis
coveredstartinginSection4.1).[Link]
alias(uptoeightcharacterslong)foranANSYScommand,GUIfunctionname,[Link]
example,MATPROPmightbeanabbreviationforamacrothatlistsmaterialproperties,SAVE_DBis
anabbreviationfortheSAVEcommand,andQUITisanabbreviationfortheFnc_/EXITfunction
(whichlaunchesthe"ExitfromANSYS"dialogbox).
[Link](and
executethemacro,command,[Link])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>[Link]
ofthemenuitemsispreferablefortworeasons:
ClickingOKautomaticallyupdatesthetoolbar(usingthe*ABBRcommandrequiresthatyou
usetheUtilityMenu>MenuCtrls>UpdateToolbarmenuitemtomakeyournew
abbreviationappearonthetoolbar).
Youcaneasilyedittheabbreviationifrequired.
Thesyntaxforthe*ABBRcommandandrelateddialogsis
*ABBR,Abbr,String
Where
[Link]
1/3
4/26/2016
APDL:Chapter2:AddingCommandstotheToolbar(UP19980820)
Abbr
[Link]
characters.
String
[Link]
nameofamacro,[Link]
usingmacros,[Link]
(usingUIDL),thenspecify"Fnc_string."Forexample,intheabbreviationdefinitionsfor
"QUIT,""POWRGRPH,"and"ANSYSWEB"shownabove,"Fnc_/QUIT,"
"Fnc_/GRAPHICS,"and"Fnc_HomePage"arealluniqueUIDLfunctionnameswhichidentify
theANSYSpickingmenuordialogboxassociatedwiththeQUIT,POWRGRPH,and
[Link]
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,[Link],youwouldenter
thevaluesshowninthefollowingfigureintheUtilityMenu>MenuCtrls>EditToolbardialog
box.
Figure22AddingaNewAbbreviation.
Thenewbuttonisappendedtothebuttonbarasshowninthefollowingfigure.
Figure23TheButtonfortheNewAbbreviation.
[Link]
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
[Link],ifyouwishtoeditalargesetofbuttonsorchangetheirorder,youmayfindusing
[Link],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)[Link]/NOPRatthetop
turnsoffechoingtothelogfilewhilethe/GOatthebottomturnslogfileechoingon.
2.2NestingToolbarAbbreviations
[Link]
abbreviationsunderonebutton,youcandefinespecializedtoolbars(ifyouhavemanyabbreviations,
havingthemonasingletoolbarcanbecluttered,makingitdifficulttofindtheproperbutton).Tonest
abbreviations,[Link],the
followingcommanddefinesPREP_ABRasanabbreviationthatrestoresabbreviationsfromthefile
[Link].
*ABBR,PREP_ABR,ABBRES,,PREP,ABBR
PREP_ABRwillappearasabuttononthetoolbar.Clickingitwillreplacetheexistingbuttonswith
[Link].
Bydefiningabbreviationstorestorethesefilesandincludingthoseabbreviationsintheappropriate
files,[Link]
[Link]
youimplementsuchahierarchy,it'sagoodpracticetoaddanabbreviationasa"return"buttonineach
filetonavigatebackthroughthemenus.
Gotothebeginningofthischapter
[Link]
3/3