Forgot password?

Create an account!

Forum

« back

RhinoScript – What's wrong on my code?

Messages

Please log in to write a message.

  • 3. caldescm (Feb 25, 2011 14.56):

    Thanks for all!!!

    It runs perfect!

  • 2. Johannes (Feb 25, 2011 12.42):

    hi,

    you have a little mistake in the line where you want to select the offset curve.

            Dim arrObjects, i, arrNewobject, a, b, c

            arrObjects = Rhino.GetObjects("Select curves to offset")

            If IsArray(arrObjects) Then

                    For i = 0 To UBound(arrObjects)


                            arrNewobject = Rhino.OffsetCurve(arrObjects(i), Array(0,0,1), 0.5, Array(1,0,0), 0)
                            a = Rhino.selectobject(arrNewobject(0))
                            b = Rhino.selectobject(arrobjects(i))
                            c = Rhino.selectedobjects
                            Rhino.AddEdgeSrf c
                            Rhino.UnselectallObjects

                    Next

            End If

    should work...

    johannes

  • 1. caldescm (Feb 25, 2011 12.19):

    Hi! I am a beginner on this... sorry!
    I'm trying to do a loop, but... something is going wrong!
    could someone help me?

    The code is:

    [Dim arrObjects, i, arrNewobject, a, b, c

    arrObjects = Rhino.GetObjects("Select curves to offset")

    If IsArray(arrObjects) Then

    For i = 0 To UBound(arrObjects)


    arrNewobject = Rhino.OffsetCurve(arrObjects(i), Array(0,0,1), 0.5, Array(1,0,0), 0)
    a = Rhino.selectobject(arrNewobject(i))
    b = Rhino.selectobject(arrobjects(i))
    c = Rhino.selectedobjects
    Rhino.AddEdgeSrf c
    Rhino.UnselectallObjects

    Next

    End If]

    Rhino shows me a wrong message (subscript out of range: "i") when it runs

    Thanks for your attention

Recommend

Why are these buttons gray?