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

任意位置绘制椭圆两法ZZ

时间:2008-09-15 11:31:33 来源:
第一种是为不熟悉命令的用户准备的,根据提示输入数据即可。

而且这样做还有一个重要的理由,就是看上去好像挺有学问。

/prep7
multipro,'start',3 !椭圆中心位置输入
*cset,1,3,x0,'X-coordinate of ellipse center',0
*cset,4,6,y0,'Y-coordinate of ellipse center',0
*cset,7,9,z0,'Z-coordinate of ellipse center',0
multipro,'end'
multipro,'start',4 !椭圆长轴
*cset,1,3,xmcomp,'Major axis X-component vector',1
*cset,4,6,ymcomp,'Major axis Y-component vector',0
*cset,7,9,zmcomp,'Major axis Z-component vector',0
*cset,10,12,major,'Major axis length',24
multipro,'end'
multipro,'start',4 !椭圆短轴
*cset,1,3,xncomp,'Minor axis X-component vector',0
*cset,4,6,yncomp,'Minor axis Y-component vector',1
*cset,7,9,zncomp,'Minor axis Z-component vector',0
*cset,10,12,minor,'Minor axis length',12
multipro,'end'
ratio=minor/major !根据输入绘制椭圆
csys,0
wplane,,x0,y0,z0,x0 xmcomp*major,y0 ymcomp*major,z0 zmcomp*major,x0 xncomp*minor,y0 yncomp*minor,z0 zncomp*minor cswpla,11,1,ratio,1
 
k,,major,,,
k,,major,90,,
k,,major,180,,
k,,major,270,,
l,kp(major,0,0),kp(major,90,0)
l,kp(major,90,0),kp(major,180,0)
l,kp(major,180,0),kp(major,270,0)
l,kp(major,270,0),kp(major,0,0)
csys,0

第二种是为了奖励有耐心看下来的同志,省事省时又好用。

/prep7
pcirc,10, ,
adele,1
lsscale,all, , , ,ratio
我转载这篇文章的另外一个目的是第一种方法里面的用multipro和*cset命令编写输入框。