Sunday, September 30, 2007

Array To Select Multiple Curves

Selecting multiple objects is easy, just use the Rhino.GetObjects method which returns an array, then cycle through the array to check each curve

Dim arrCurve, intShort

intShort = Rhino.GetReal ("min. length to keep?", 0.1)
arrCurve = Rhino.GetObjects ("select a curves to evaluate", 4)

Dim i

For i = 0 to Ubound(arrCurve)
If Rhino.CurveLength (arrCurve(i)) > intShort Then
Call Rhino.ObjectLayer (arrCurve(i), "Curve")
Else
Call Rhino.DeleteObject (arrCurve(i))
End If
Next