脚本如下
…
#coding=utf-8
import rhinoscriptsyntax as rs
#创建外径
a=rs.AddPoint(0,0,0)
b=rs.AddPoint(0,44,0)
c=rs.AddPoint(44,44,0)
d=rs.AddPoint(44,0,0)
a1=rs.AddPoint(0,0,0)
l1=rs.AddPolyline([a,b,c,d,a1])
#创建内径
e=rs.AddPoint(10,10,0)
f=rs.AddPoint(10,34,0)
g=rs.AddPoint(34,34,0)
h=rs.AddPoint(34,10,0)
e1=rs.AddPoint(10,10,0)
l2=rs.AddPolyline([e,f,g,h,e1])
#生成截面
surface=rs.AddLoftSrf([l1,l2])
#拉伸成体
curve = rs.AddLine((0,0,0), (0,0,20))
rs.ExtrudeSurface(surface,curve)
…