0% found this document useful (0 votes)
331 views

APDL - Chapter 2 - Adding Commands To The Toolbar (UP19980820)

This document discusses how to add frequently used commands and macros to the ANSYS toolbar for easy access. It describes how to define abbreviations using the *ABBR command or menu items, which create buttons on the toolbar that execute the associated command or macro. These abbreviations can be saved to a file and loaded in future sessions. Additionally, abbreviations can be "nested" by defining buttons that load other files containing more abbreviations, allowing creation of customized toolbar menus.

Uploaded by

Mohammad Althaf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
331 views

APDL - Chapter 2 - Adding Commands To The Toolbar (UP19980820)

This document discusses how to add frequently used commands and macros to the ANSYS toolbar for easy access. It describes how to define abbreviations using the *ABBR command or menu items, which create buttons on the toolbar that execute the associated command or macro. These abbreviations can be saved to a file and loaded in future sessions. Additionally, abbreviations can be "nested" by defining buttons that load other files containing more abbreviations, allowing creation of customized toolbar menus.

Uploaded by

Mohammad Althaf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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

You might also like