Professional Documents
Culture Documents
ANSYSCommandFileCreationandExecution
UofAANSYSTutorial
CreatingFiles
Features
BasicTutorials
ANSYS
UTILITIES
BASIC
TUTORIALS
INTERMEDIATE
TUTORIALS
ADVANCED
TUTORIALS
POSTPROC.
TUTORIALS
COMMAND
LINEFILES
PRINTABLE
VERSION
ANSYSCommandFileCreationandExecution
GeneratingtheCommandFile
IntermediateTutorials
AdvancedTutorials
PostProcTutorials
Therearetwochoicestogeneratethecommandfile:
1.Directlytypeinthecommandsintoatextfilefromscratch.Thisassumesagoodknowledgeof
theANSYScommandlanguageandtheassociatedoptions.
Radiation
Index
Contributions
Comments
MecE563
MechanicalEngineering
UniversityofAlberta
Ifyouknowwhatsomeofthecommandsandareunsureofothers,executethedesiredoperation
fromtheGUIandthengotoFile>List>LogFile.Thiswillthenopenupanewwindow
showingthecommandlineequivialentofallcommandsenteredtothispoint.Youmaydirectly
cutandpastefromheretoatexteditor,orifyou'dliketosavethewholefile,seethenextitemin
thislist.
2.SetupandsolvetheproblemasyounormallywouldusingtheANSYSgraphicuserinterface
(GUI).Thenbeforeyouarefinished,enterthecommandFile>SaveDBLogFileThissaves
theequivalentANSYScommandsthatyouenteredintheGUImode,toatextfile.Youcannow
editthisfilewithatexteditortocleanitup,deleteerrorsfromyourGUIuseandmakechanges
asdesired.
RunningtheCommandFile
ANSYSInc.
ToruntheANSYScommandfile,
savetheASCIItextcommandsinatextfilee.g.frame.cmd
startupeithertheGUIortextmodeofANSYS
Copyright2001
UniversityofAlberta
GUICommandFileLoading
TorunthiscommandfilefromtheGUI,youwoulddothefollowing:
FromtheFilemenu,selectReadInputfrom....Changetotheappropriatedirectorywherethe
file(frame.cmd)isstoredandselectit.
NowANSYSwillexecutethecommandsfromthatfile.Theoutputwindowshowstheprogress
ofthisprocedure.Anyerrorsandwarningswillbelistedinthiswindow.
Whenitiscomplete,youmaynothaveafullviewofyourstructureinthegraphicwindow.You
mayneedtoselectPlot>ElementsorPlot>Linesorwhathaveyou.
Assumingthattheanalysisworkedproperly,youcannowusethepostprocessortoviewelement
deflections,stress,etc.
Ifyouwanttofixsomeerrorsormakesomechangestothecommandfile,makethosechangesin
aseparatewindowinatexteditor.Savethosechangestodisk.
Torerunthecommandfile,youshouldfirstofallclearthecurrentmodelfromANSYS.Select
File>Clear&StartNew.
ThenreadinthefileasbeforeFile>ReadInputfrom...
CommandLineFileLoading
Alternatively,youcanalsoreadinthecommandfilerightfromtheANSYScommandline.Assuming
thatyoustartedANSYSusingthecommands...
/ansys52/bin/ansysu52
andthenentered
/show,x11c
ThishasnowstartedANSYSinthetextmodeandhastolditwhatgraphicdevicetouse(inthiscasean
XWindows,X11c,mode).Atthispointyoucouldtypein/menu,on,butyoumightnotwanttoturnon
thefullgraphicmodeifworkingonaslowmachineorifyouareexecutingtheprogramremotely.Let's
assumethatwedon'tturnthemenumodeon...
IfthecommandfileisinthecurrentdirectoryforANSYS,thenfromtheANSYSinputwindow,type
/input,frame,cmd
http://www.mece.ualberta.ca/tutorials/ansys/CL/Create.html
1/3
5/9/2016
ANSYSCommandFileCreationandExecution
andyesthatisacomma(,)betweenframeandcmd.IfANSYScannotfindthefileinthecurrent
directory,youmayneedtopointittotheproperdirectory.Ifthefilewasinthedirectory,
/myfiles/ansys/frameforexample,youwouldusethefollowingsyntax
/input,frame,cmd,/myfiles/ansys/frame
Ifyouwanttorerunanewormodifiedfile,itisnecessarytoclearthecurrentmodelinmemorywith
thecommand
/clear,start
Thisfullprocedureofloadingincommandfilesandclearingjobsandstartingoveragaincanbe
completedasmanytimesasdesired.
ANSYSCommandGroupings
ANSYScontainshundredsofcommandsforgeneratinggeometry,applyingloadsandconstraints,
settingupdifferentanalysistypesandpostprocessing.Thefollowingisonlyabriefsummaryofsome
ofthemorecommoncommandsusedforstructuralanalysis.
Category
Basic
Geometry
Solid
Modeling
(Primitives)
Boolean
Operations
Command
Description
Syntax
keypointdefinition
k,kp#,xcoord,ycoord,zcoord
straightlinecreation
l,kp1,kp2
larc
circulararcline
(fromkeypoints)
larc,kp1,kp2,kp3,rad
(kp3definesplane)
circle
circularlinecreation
(createskeypoints)
seeonlinehelp
spline
splinelinethroughkeypoints
spline,kp1,kp2,...kp6
areadefinitionfromkeypoints
a,kp1,kp2,...kp18
al
areadefinitionfromlines
a,l1,l2,...l10
volumedefinitionfrom
keypoints
v,kp1,kp2,...kp8
va
volumedefinitionfromareas
va,a1,a2,...a10
vext
createvolumefromarea
extrusion
seeonlinehelp
vdrag
createvolumebydraggingarea
alongpath
seeonlinehelp
rectng
rectanglecreation
rectng,x1,x2,y1,y2
block
blockvolumecreation
block,x1,x2,y1,y2,z1,z2
cylind
cylindricalvolumecreation
cylind,rad1,rad2,z1,z2,theta1,theta2
sphere
sphericalvolumecreation
sphere,rad1,rad2,theta1,theta2
prism
cone
torus
variousvolumecreation
commands
seeonlinehelp
aadd
addsseparateareastocreate
singlearea
aadd,a1,a2,...a9
aglue
createsnewareasbyglueing
(propertiesremainseparate)
aglue,a1,a2,...a9
asba
creatnewareabyarea
substraction
asba,a1,a2
aina
createnewareabyarea
intersection
aina,a1,a2,...a9
volumebooleanoperations
seeonlinehelp
vadd
vlgue
vsbv
http://www.mece.ualberta.ca/tutorials/ansys/CL/Create.html
2/3
5/9/2016
ANSYSCommandFileCreationandExecution
vinv
Elements&
Meshing
Sets&
Selection
Constraints
Loads
et
defineselementtype
et,number,type
maydefineasmanyasrequired
currenttypeissetbytype
type
setcurrentelementtypepointer
type,number
definerealconstantsfor
elements
r,number,r1,r2,...r6
maydefineasmanyasrequired
currenttypeissetbyreal
real
setscurrentrealconstantpointer real,number
mp
setsmaterialpropertiesfor
elements
mp,label,number,c0,c1,...c4
maydefineasmanyasrequired
currenttypeissetbymat
mat
setscurrentmaterialproperty
pointer
mat,number
esize
setssizeornumberofdivisions
onlines
esize,size,ndivs
useeithersizeorndivs
eshape
controlselementshape
seeonlinehelp
lmesh
meshline(s)
lmesh,line1,line2,inc
orlmesh,all
amesh
mesharea(s)
amesh,area1,area2,inc
oramesh,all
vmesh
meshvolume(s)
vmesh,vol1,vol2,inc
orvmesh,all
ksel
selectasubsetofkeypoints
seeonlinehelp
nsel
selectasubsetofnodes
seeonlinehelp
lsel
selectasubjsetoflines
seeonlinehelp
asel
selectasubsetofareas
seeonlinehelp
nsla
selectnodeswithinselected
area(s)
seeonlinehelp
allsel
selecteverything
i.e.resetselection
allsel
dk
definesaDOFconstraintona
keypoint
dk,kp#,label,value
labels:
UX,UY,UZ,ROTX,ROTY,ROTZ,ALL
definesaDOFconstraintona
node
d,node#,label,value
labels:
UX,UY,UZ,ROTX,ROTY,ROTZ,ALL
dl
defines(anti)symmetryDOF
constraintsonaline
dl,line#,area#,label
labels:SYMM(symmetry)ASYM
(antisymmetry)
fk
definesa
fk,kp#,label,value
labels:FX,FY,FZ,MX,MY,MZ
definesaforceatanode
f,node#,label,value
labels:FX,FY,FZ,MX,MY,MZ
http://www.mece.ualberta.ca/tutorials/ansys/CL/Create.html
3/3