|
addpoint不是把一个点加到数组里 而是画点
所以你arrpoints里没有东西
这样是你要的么
Option Explicit
'Script written by <insert name>
'Script copyrighted by <insert company name>
'Script version Sunday, 08 August 2010 22:34:25
Call Main()
Sub main()
Dim arrpt(2)
Dim r:r=getinteger("number of interger",16,2)
Dim j:j=getinteger("number of interger",1,1)
Dim i,h
Dim k:k=0
Dim pi:pi =Rhino.pi
Dim arrpoints(12)
For h=0 To 2
For i=0 To 2
arrpt(0)=(r+h*0.04)*Cos(i*2/3*pi)
arrpt(1)=(r+h*0.04)*Sin(i*2/3*pi)
arrpt(2)=h*j
arrpoints(k)=arrpt
arrpt(0)=((r+h*0.04)-((40-h)*0.05))*Cos(i*2/3*pi+1/6*pi)
arrpt(1)=((r+h*0.04)-((40-h)*0.05))*Sin(i*2/3*pi+1/6*pi)
arrpt(2)=h*j
arrpoints(k+1)=arrpt
arrpt(0)=((r+h*0.04)-(40-h)*0.15)*Cos(i*2/3*pi+1/3*pi)
arrpt(1)=((r+h*0.04)-(40-h)*0.15)*Sin(i*2/3*pi+1/3*pi)
arrpt(2)=h*j
arrpoints(k+2)=arrpt
arrpt(0)=((r+h*0.04)-(40-h)*0.05)*Cos(i*2/3*pi+1/2*pi)
arrpt(1)=((r+h*0.04)-(40-h)*0.05)*Sin(i*2/3*pi+1/2*pi)
arrpt(2)=h*j
arrpoints(k+3)=arrpt
k=k+4
Next
If IsArray(arrPoints) Then
arrpoints(12)=array(r+h*0.04,0,h*j)
Rhino.AddInterpCurve arrpoints
rhino.AddPoints arrpoints
k=0
Else Rhino.print("error")
End If
Next
End Sub |
|