Forgot password?

Create an account!

Forum

« back

RhinoScript – AddLoftSrf

Messages

Please log in to write a message.

  • 1. Till (Jul 08, 2010 15.09):

    hi there, i am just cleaning up a script i have written to design rings. worked around several problems till it worked but still want to solve some of these issues. somehow rhino script does not accept my ordered string arrays to perform the addLoftSrf command. to select the curves i used ObjectsByType instead. I still like to use the array of curves somehow. any help with this.
    cheers, till

    here is a basic script to illustrate the problem:

    Call Main()
    Sub Main()

    Dim arrPlane(), strCr(), strCrv()
    Dim rI : rI = 9
    Dim rO : rO = 12
    Dim rH : rH = 5
    Dim n

    Dim arrLoft

    Rhino.EnableRedraw False


    'crv //

    For n = 0 To 3
    ReDim arrPlane(n)
    ReDim strCr(n)
    ReDim strCrv(n)
    'low in
    If n = 0 Then
    arrPlane(n) = Rhino.WorldXYPlane
    arrPlane(n) = Rhino.MovePlane (arrPlane(n),array(0,0,-0.5*rH))
    strCr(n) = rhino.AddCircle(arrPlane(n),rI)

    End If
    'low out
    If n = 1 Then
    arrPlane(n) = Rhino.WorldXYPlane
    arrPlane(n) = Rhino.MovePlane (arrPlane(n),array(0,0,-0.5*rH))
    strCr(n) = rhino.AddCircle(arrPlane(n),rO)

    End If
    'up out
    If n = 2 Then
    arrPlane(n) = Rhino.WorldXYPlane
    arrPlane(n) = Rhino.MovePlane (arrPlane(n),array(0,0,0.5*rH))
    strCr(n) = rhino.AddCircle(arrPlane(n),rO)

    End If
    'up in
    If n = 3 Then
    arrPlane(n) = Rhino.WorldXYPlane
    arrPlane(n) = Rhino.MovePlane (arrPlane(n),array(0,0,0.5*rH))
    strCr(n) = rhino.AddCircle(arrPlane(n),rI)

    End If

    strCrv(n) = Rhino.FitCurve (strCr(n),3)
    Rhino.DeleteObjects array(strCr(n))
    Next

    ' /

    'srf /

    arrLoft = array(strCrv(0),strCrv(1),strCrv(2),strCrv(3))

    'arrLoft = Rhino.ObjectsByType (4,True)
    Rhino.AddLoftSrf arrLoft,,,,,,True

    Rhino.EnableRedraw True


    End Sub

Recommend

Why are these buttons gray?