Forgot password?

Create an account!

Forum

« back

RhinoScript – Newbie Questing

Messages

Please log in to write a message.

  • 3. awd033 (Mar 16, 2015 14.25):

    thx a lot!

  • 2. pulgarata (Mar 16, 2015 13.08):

    Hi,
    You have to write a condition to the loop:

    Sub DrawMultiLines()
            Dim arrStartPt, arrEndPt, arrAllLns
            Do
                    arrStartPt = Rhino.GetPoint()
                    arrEndPt = Rhino.GetPoint()
                    ''this is a contition to draw the line if is all OK,
                    ''to avoid an error.
                    If isarray(arrStartPt) And isarray(arrEndPt) Then
                            Rhino.AddLine arrStartPt, arrEndPt
                    End If
                    ''this is the condition to the loop. In the place
                    ''of "Until ..." also could write "while ..."
            Loop Until isnull(arrStartPt) Or isnull(arrEndPt)
    End Sub

    Sebastián,

  • 1. awd033 (Mar 14, 2015 11.07):

    i am trying to use "do...loop" to write a script that can add lines and end when user press enter. But have some problem with how to stop the loop. Please help me out :)

    Option Explicit
    Call DrawMultiLines()

    Sub DrawMultiLines()
    Dim arrStartPt, arrEndPt, arrAllLns
    Do arrStartPt = Rhino.GetPoint()
    arrEndPt = Rhino.GetPoint()
    Rhino.AddLine arrStartPt, arrEndPt
    Loop
    End Sub

Recommend

Why are these buttons gray?