This tutorial was completed using ANSYS 7.0 The purpose of this tutorial is to familiarize the user with the ANSYS Parametric Design Language (APDL). This will be a very basic introduction to APDL, covering things like variable definition and simple looping. Users familiar with basic programming languages will probably find the APDL very easy to use. To learn more about APDL and see more complex examples, please see the APDL Programmer's Guide located in the help file.

This tutorial will cover the preprocessing stage of constructing a truss geometry. Variables including length, height and number of divisions of the truss will be requested and the APDL code will construct the geometry.


ANSYS Command Listing

finish
/clear

/prep7

*ask,LENGTH,How long is the truss,100
*ask,HEIGHT,How tall is the truss,20
*ask,DIVISION,How many cross supports even number,2

DELTA_L = (LENGTH/(DIVISION/2))/2
NUM_K = DIVISION + 1
COUNT = -1
X_COORD = 0

*do,i,1,NUM_K,1

COUNT = COUNT + 1
OSCILATE = (-1)**COUNT

X_COORD = X_COORD + DELTA_L

*if,OSCILATE,GT,0,THEN
k,i,X_COORD,0

*else
k,i,X_COORD,HEIGHT

*endif

*enddo


KEYP = 0

*do,j,1,DIVISION,1
KEYP = KEYP + 1

L,KEYP,(KEYP+1)

*if,KEYP,LE,(DIVISION-1),THEN
L,KEYP,(KEYP+2)
*endif
*enddo

et,1,link1
r,1,100
mp,ex,1,200000
mp,prxy,1,0.3

esize,,1
lmesh,all

finish