Forgot password?

Create an account!

Forum

« back

RhinoScript – Rhino.command question

Messages

Please log in to write a message.

  • 6. FredrikW (Mar 29, 2011 17.44):

    Thanks!!

    It still doesn't fit circles to each individual curve.
    I somehow need to select all the points before the rhino.command...
    Fiddled around a bit now, still did't find out..



    Cheers!
    Fredrik

  • 5. Hanno (Mar 29, 2011 14.02):

    Hi,

    in the line

    strPt = Rhino.Pt2Str (arrPoint)

    you are overwriting strPt in every iteration, so after the loop it only contains your last point. Try changing it to

    strPt = strPt & Rhino.Pt2Str (arrPoint, , True)

    The last parameter automatically adds a space character to the converted point (see Rhinoscript help). BTW: You need to add some spaces in your rhino.command line, too...

    Hanno

  • 4. FredrikW (Mar 29, 2011 12.31):

    Still have problems fetching those points!

    -Fredrik


    Option Explicit
    'Script written by <insert name>
    'Script copyrighted by <insert company name>
    'Script version 5. februar 2009 14:25:30

    Call Main()
    Sub Main


    Dim sObject, arrObjects, arrPoints, arrPoint, i, strPt
    i=0

    arrObjects=Rhino.GetObjects ("Velg 'sirkler' som skal gjøres om til ordentlige sirkler", 4, False, True, False)

    For Each sObject In arrObjects

    For i= 0 To Ubound(arrObjects)
    Next




    Rhino.EnableObjectGrips sObject
    arrPoints = Rhino.CurveEditPoints(sObject)

    If IsArray(arrPoints) Then

    For Each arrPoint In arrPoints

    strPt = Rhino.Pt2Str (arrPoint)

    Next

    End If



    Rhino.Command "Circle FitPoints" & strPt & "Enter"

    Rhino.EnableObjectGrips sObject, False




    Next
    End Sub

  • 3. FredrikW (Mar 29, 2011 12.23):

    Hanno!

    Thanks for speedy reply !1


    :)

    Fredrik

  • 2. Hanno (Mar 29, 2011 12.20):

    Hi,

    if you want to use your points in a command, you need to convert them into strings. You can use Rhino.Pt2Str for this. Note that you cannot feed an array of points into this function; you have to loop through your points and convert them separately.

    Hanno

  • 1. FredrikW (Mar 29, 2011 12.04):

    Hi

    I want to run the Circle FitPoints, using the curves edit points as input, on a bunch of curves. What i want to do is to make some imperfect "circles" into real circles.

    But I am having problems passing the edit points array to the Rhino.command...

    i tried using & arrPoints & but that obviously isn't right...



    Anyone have some useful tips?

    Best,
    Fredrik

    Option Explicit
    'Script written by <insert name>
    'Script copyrighted by <insert company name>
    'Script version 5. februar 2009 14:25:30

    Call Main()
    Sub Main


    Dim sObject, arrObjects, arrPoints, arrPoint, i
    i=0

    arrObjects=Rhino.GetObjects ("Velg 'sirkler' som skal gjøres om til ordentlige sirkler", 4, False, True, False)

    For Each sObject In arrObjects

    For i= 0 To Ubound(arrObjects)
    Next





    arrPoints = Rhino.CurveEditPoints(sObject)


    Rhino.Command "Circle FitPoints" & arrPoints & "Enter"





    Next
    End Sub

Recommend

Why are these buttons gray?