Hi, sorry to bother you, I found this script which is great thank you very much, but I want to group the curves and I can’t get it to work
‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’
’ DivideCurveDashed.rvb – October 2010
’ If this code works, it was written by Dale Fugier.
’ If not, I don’t know who wrote it.
’ Works with Rhino 4.0 and 5.0.
‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’Option Explicit
’ Divides a curve into “dashed” segments
Call DivideCurveDashed
Sub DivideCurveDashed
Dim arrSel,arrObjs,strGroup,msg,strBC
Dim curve, slength, dlength
Dim i, length, pt, t, dom, resultscurve = Rhino.GetObject(“Select curve to divide”, 4, True)
If IsNull(curve) Then Exit Subslength = Rhino.GetReal(“Segment length”, 1.0)
If IsNull(slength) Then Exit Sub
If (slength <= 0) Then Exit Subdlength = Rhino.GetReal(“Dash length”, 1.0)
If IsNull(dlength) Then Exit Sub
If (dlength <= 0) Then Exit SubCall Rhino.EnableRedraw(False)
i = 0Do
If (i Mod 2 = 0) Then length = slength Else length = dlength End If pt = Rhino.CurveArcLengthPoint(curve, length) If IsNull(pt) Then Exit Do t = Rhino.CurveClosestPoint(curve, pt) If (i Mod 2 = 0) Then results = Rhino.SplitCurve(curve, t, True) curve = results(1) Else dom = Rhino.CurveDomain(curve) curve = Rhino.TrimCurve(curve, Array(t, dom(1)), True) End If i = i + 1
Loop While True
Call Rhino.EnableRedraw(True)
Call Rhino.Command(“_SelLast”)
arrObjs = Rhino.SelectedObjectsIf IsArray(arrObjs) Then
strGroup = Rhino.AddGroup
Call Rhino.AddObjectsToGroup(arrObjs, strGroup)
Call Rhino.AddObjectToGroup(strBC, strGroup)
Call Rhino.ObjectsByGroup(strGroup, True)
If IsArray(arrSel) Then Call Rhino.SelectObjects(arrSel)
End IfEnd Sub
original link