2. ANSYS Command File Creation and Execution http://www.mece.ualberta.ca/tutorials/ansys/CL/Create.html
This has now started ANSYS in the text mode and has told it what graphic device to use (in this case an
X Windows, X11c, mode). At this point you could type in /menu,on, but you might not want to turn on
the full graphic mode if working on a slow machine or if you are executing the program remotely. Let's
assume that we don't turn the menu mode on...
If the command file is in the current directory for ANSYS, then from the ANSYS input window, type
/input,frame,cmd
and yes that is a comma (,) between frame and cmd. If ANSYS can not find the file in the current
directory, you may need to point it to the proper directory. If the file was in the directory, /myfiles
/ansys/frame for example, you would use the following syntax
/input,frame,cmd,/myfiles/ansys/frame
If you want to rerun a new or modified file, it is necessary to clear the current model in memory with
the command
/clear,start
This full procedure of loading in command files and clearing jobs and starting over again can be
completed as many times as desired.
ANSYS Command Groupings
ANSYS contains hundreds of commands for generating geometry, applying loads and constraints, setting
up different analysis types and post-processing. The following is only a brief summary of some of the
more common commands used for structural analysis.
Category Command Description Syntax
Basic
k keypoint definition k,kp#,xcoord,ycoord,zcoord
Geometry
l straight line creation l,kp1,kp2
circular arc line larc,kp1,kp2,kp3,rad
larc
(from keypoints) (kp3 defines plane)
circular line creation
circle see online help
(creates keypoints)
spline line through
spline spline,kp1,kp2, ... kp6
keypoints
area definition from
a a,kp1,kp2, ... kp18
keypoints
al area definition from lines a,l1,l2, ... l10
volume definition from
v v,kp1,kp2, ... kp8
keypoints
volume definition from
va va,a1,a2, ... a10
areas
create volume from area
vext see online help
extrusion
create volume by dragging
vdrag see online help
area along path
Solid
Modeling rectng rectangle creation rectng,x1,x2,y1,y2
(Primitives)
block block volume creation block,x1,x2,y1,y2,z1,z2
2 of 4 10/11/2011 3:36 PM
3. ANSYS Command File Creation and Execution http://www.mece.ualberta.ca/tutorials/ansys/CL/Create.html
cylindrical volume
cylind cylind,rad1,rad2,z1,z2,theta1,theta2
creation
sphere spherical volume creation sphere,rad1,rad2,theta1,theta2
prism
various volume creation
cone see online help
commands
torus
Boolean adds separate areas to
aadd aadd,a1,a2, ... a9
Operations create single area
creates new areas by
glueing
aglue aglue,a1,a2, ... a9
(properties remain
separate)
creat new area by area
asba asba,a1,a2
substraction
create new area by area
aina aina,a1,a2, ... a9
intersection
vadd
vlgue
volume boolean operations see online help
vsbv
vinv
et,number,type
Elements &
et defines element type may define as many as required; current type
Meshing
is set by type
set current element type
type type,number
pointer
r,number,r1,r2, ... r6
define real constants for
r may define as many as required; current type
elements
is set by real
sets current real constant
real real,number
pointer
mp,label,number,c0,c1, ... c4
sets material properties for
mp may define as many as required; current type
elements
is set by mat
sets current material
mat mat,number
property pointer
sets size or number of esize,size,ndivs
esize
divisions on lines use either size or ndivs
eshape controls element shape see online help
lmesh,line1,line2,inc
lmesh mesh line(s)
or lmesh,all
amesh,area1,area2,inc
amesh mesh area(s)
or amesh,all
vmesh,vol1,vol2,inc
vmesh mesh volume(s)
or vmesh,all
Sets & select a subset of
ksel see online help
Selection keypoints
nsel select a subset of nodes see online help
lsel select a subjset of lines see online help
asel select a subset of areas see online help
3 of 4 10/11/2011 3:36 PM
4. ANSYS Command File Creation and Execution http://www.mece.ualberta.ca/tutorials/ansys/CL/Create.html
select nodes within
nsla see online help
selected area(s)
select everything
allsel allsel
i.e. reset selection
defines a DOF constraint dk,kp#,label,value
Constraints dk
on a keypoint labels: UX,UY,UZ,ROTX,ROTY,ROTZ,ALL
defines a DOF constraint d,node#,label,value
d
on a node labels: UX,UY,UZ,ROTX,ROTY,ROTZ,ALL
dl,line#,area#,label
defines (anti)symmetry
dl labels: SYMM (symmetry); ASYM
DOF constraints on a line
(antisymmetry)
fk,kp#,label,value
Loads fk defines a
labels: FX,FY,FZ,MX,MY,MZ
f,node#,label,value
f defines a force at a node
labels: FX,FY,FZ,MX,MY,MZ
4 of 4 10/11/2011 3:36 PM