您的位置:网站首页 > Ansys教程

在ANSYS里生成弹簧实体的命令流

时间:2008-09-15 12:55:01 来源:

在ANSYS里生成弹簧实体的命令流

fini
/clear,start
/prep7
r=1 ! radius of spring
rs=0.3 ! radius of wire
n=20 ! segment number in a lead
s=2 ! lead
pi=3.14159265

! create keypoints
*do,i,1,n+6+3*n,1
x=r*cos((i-1)*2*pi/n)
y=r*sin((i-1)*2*pi/n)
z=(i-1)*s/n
k,i,x,y,z
*enddo

! create splines
*do,i,1,n+1+3*n,5
bsplin,i,i+1,i+2,i+3,i+4,i+5
*enddo

! add all splines into a spline
lcomb,all

! create a section
csys,4 ! change active cs into workplane cs
wpro,,90 ! rotation work plane to 90 degree around x axis
cyl4,kx(1),ky(1),rs,360 ! draw section of wire

wpro,,-90 ! resume direction of work plane

! sweep section to obtain entity
vdrag,1,,,,,,1