Forgot password?

Create an account!

Forum

« back

RhinoScript – ApplyCrv multiple

Messages

Please log in to write a message.

  • 3. dingle (Feb 26, 2009 18.25):

    great, go ahead and add it - but i just found a problem. if you have several groups of curves to apply, then the script works but the result fails.

  • 2. Hanno (Feb 25, 2009 19.03):

    Hi!

    Looks good, do you want to add it to the scripts on this site?

    Greetings

    Hanno

  • 1. dingle (Feb 23, 2009 12.35):

    hey there, just wrote this simple one to save me some effort. performs the rhino command ApplyCrv for multiple selected curves and one surface.
    let me know if i overlooked a potential for error.
    dingle

    Option Explicit
    'Script written by AM
    'Script version Monday, 23 February 2009 12:19:34

    Call ApplyCrvMultiple()
    Sub ApplyCrvMultiple()
           
            Dim strCurves, strSrf
            Dim i
           
            strCurves = Rhino.GetObjects("Select curves to apply", 4)
            If IsNull(strCurves) Then Exit Sub
           
            strSrf = Rhino.GetObject("Select target surface", 8)
            If IsNull(strSrf) Then Exit Sub
           
            Rhino.EnableRedraw(False)
           
            For i=0 To UBound(strCurves)
                    If Rhino.IsCurvePlanar(strCurves(i)) Then
                                           
                            Rhino.SelectObject strCurves(i)
                            Rhino.SelectObject strSrf
                            Rhino.Command "ApplyCrv"
                            Rhino.UnselectAllObjects
                   
                    End If

            Next
           
            Rhino.EnableRedraw(True)
           
    End Sub
Recommend

Why are these buttons gray?