ANSYS Command File Creation and Execution
Generating the Command File
There are two choices to generate the command file: 1. Directly type in the commands into a text file from scratch. This assumes a good knowledge of the ANSYS command language and the associated options. If you know what some of the commands and are unsure of others, execute the desired operation from the GUI and then go to File -> List ->
Log File. This will then open up a new window showing the command
line equivialent of all commands entered to this point. You may directly cut and paste from here to a text editor, or if you'd like to save the whole file, see the next item in this list. 2. Setup and solve the problem as you normally would using the ANSYS graphic user interface (GUI). Then before you are finished, enter the command File -> Save DB Log File This saves the equivalent ANSYS commands that you entered in the GUI mode, to a text file. You can now edit this file with a text editor to clean it up, delete errors from your GUI use and make changes as desired.
Running the Command File
To run the ANSYS command file,
save the ASCII text commands in a text file; e.g. frame.cmd start up either the GUI or text mode of ANSYS
GUI Command File Loading
To run this command file from the GUI, you would do the following:
From the File menu, select Read Input from.... Change to the appropriate directory where the file (frame.cmd) is stored and select it.
.. If the file was in the directory. Select File -> Clear & Start New.. Any errors and warnings will be listed in this window. then from the ANSYS input window. Let's assume that we don't turn the menu mode on. applying loads and constraints./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. you should first of all clear the current model from ANSYS. you would use the following syntax
Command Line File Loading
Alternatively. If the command file is in the current directory for ANSYS. At this point you could type in /menu. you can also read in the command file right from the ANSYS command line. When it is complete. type
/input. you may not have a full view of your structure in the graphic window. make those changes in a separate window in a text editor.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. Save those changes to disk.
ANSYS Command Groupings
ANSYS contains hundreds of commands for generating geometry.) between frame and cmd. setting up different analysis types and post-processing. mode). The following is
This has now started ANSYS in the text mode and has told it what graphic device to use (in this case an X Windows.frame. To rerun the command file. /myfiles/ansys/frame for example.•
Now ANSYS will execute the commands from that file. X11c.. you can now use the postprocessor to view element deflections.cmd
and yes that is a comma (. You may need to select Plot -> Elements or Plot -> Lines or what have you.
and then entered
/show. If you want to fix some errors or make some changes to the command file.start
This full procedure of loading in command files and clearing jobs and starting over again can be completed as many times as desired. Assuming that the analysis worked properly.cmd.frame. The output window shows the progress of this procedure. Assuming that you started ANSYS using the commands. If ANSYS can not find the file in the current directory. Then read in the file as before File -> Read Input from. you may need to point it to the proper directory.
y2 block.kp#.kp1.x1. Category Basic Geometry Command k l larc Description keypoint definition straight line creation Syntax k.kp2.. ..z2 cylind..kp2. a10
see online help
vdrag Solid rectng Modeling (Primitives) block cylind sphere
create volume by see online help dragging area along path rectangle creation block volume creation cylindrical volume creation rectng.rad1.y1.l2. .only a brief summary of some of the more common commands used for structural analysis.kp1.kp2
circular arc line larc.zcoord l..kp1. .xcoord.z2.theta2
spherical volume sphere.theta2 creation
va.a2.y1.kp3. . kp18 a.kp1.rad2.kp2..x2.y2.rad (from keypoints) (kp3 defines plane) circular line creation (creates keypoints) spline line through keypoints area definition from keypoints area definition from lines volume definition from keypoints volume definition from areas create volume from area extrusion see online help
spline a al v
spline.kp2.ycoord.rad1. ..theta1. l10 v.kp1...theta1.rad2.x1.z1.x2. kp6 a..
a2.ndivs number of use either size or ndivs divisions on lines controls element shape see online help
.... . a9
creates new areas by glueing aglue. r6 may define as many as required. current type is set by mat
defines element type set current element type pointer define real constants for elements sets current real constant pointer sets material properties for elements
sets current material property mat. .a2 area substraction create new area by area intersection volume boolean operations aina.c1.number mp. current type is set by real real.number.r2.. a9
asba aina vadd vlgue vsbv vinv Elements & et Meshing
see online help et.r1.a1..a1. .a1.a1.number r.number. current type is set by type type..label.prism cone torus Boolean Operations aadd
various volume creation commands adds separate areas to create single area
see online help
aadd.c0.a2.a2.number pointer sets size or esize. a9 (properties remain separate) creat new area by asba..number..type may define as many as required.size. ... c4 may define as many as required. .
UY.ROTY.inc or vmesh.inc or amesh.line#.inc or lmesh.MZ
defines a force at f.ROTY.lmesh amesh vmesh Sets & Selection ksel nsel lsel asel nsla
mesh line(s) mesh area(s) mesh volume(s)
lmesh.label labels: SYMM (symmetry).UZ.MX.area2.value labels: FX.label.node#.node#.MY.label.e.vol2.ALL dl.UZ.area#.line2.ROTX.UY.FZ.all
select a subset of see online help keypoints select a subset of see online help nodes select a subjset of lines see online help
select a subset of see online help areas select nodes within selected area(s) see online help
select everything allsel i.value labels: UX.ROTZ. reset selection defines a DOF constraint on a keypoint defines a DOF constraint on a node defines (anti)symmetry DOF constraints on a line defines a dk.all amesh.FZ.ALL d.FY.MX.label.MZ
.vol1.kp#.ROTZ.MY.ROTX.FY.value a node labels: FX.value labels: UX.area1.label.line1.all vmesh.kp#. ASYM (antisymmetry) fk.