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

ANSYS中生成一个锥形弹簧的命令流

时间:2010-01-29 23:45:51 来源:

fini
/clear,start
/prep7

r=3 ! radius of spring
rs=0.3 ! radius of wire
n=20 ! segment number in a lead
s=1 ! lead
pi=3.14159265

! create keypoints
*do,i,1,n+6+3*n,1
  x=(n+6+3*n-i+18)/(n+6+3*n)*r*cos((i-1)*2*pi/n)
  y=(n+6+3*n-i+18)/(n+6+3*n)*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
!wpstyle,0.05,0.1,-1,1,0.003,1,2,,5

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