Forgot password?

Create an account!

Forum

« back

RhinoScript – CInt: what am i doing wrong?

Messages

Please log in to write a message.

  • 3. dingle (Apr 06, 2009 10.05):

    thanks very much!

  • 2. Hanno (Apr 01, 2009 14.20):

    Hi,

    in VBScript the int datatype is only 16 bit, that is from -32768 to 32767. Try to use cLng (which uses the long datatype) instead of cInt.

  • 1. dingle (Mar 27, 2009 01.20):

    super simple, throws "Overflow: CInt" for some curves. No problem acquiring the curve length or by using 1 as the divisor instead of 10.
    am i missing something?
    thanks guys

    Call LengthDot()
    Sub LengthDot()
           
            Dim strObjects, dblLength, strText, strDot
            Dim i
           
            strObjects = Rhino.GetObjects("Select lines for length dot", 4, True, True)
            If IsNull(strObjects) Then Exit Sub
           
            Rhino.EnableRedraw(False)
           
            For i=0 To UBound(strObjects)
                   
                    dblLength = Rhino.CurveLength(strObjects(i))
                    strText = CStr((CInt(dblLength*10))/10)
                    strDot = Rhino.AddTextDot(strText, Rhino.CurveMidPoint(strObjects(i)))
                   
            Next
           
            Rhino.EnableRedraw(True)
           
    End Sub
Recommend

Why are these buttons gray?