Option Explicit 'Script written by Russell Loveridge 'Script copyrighted by RAL:lapa.epfl.ch 'This script shows the difference between the AddCurve and AddInterpCurve commands. Call Makepolyline() Sub Makepolyline() Dim arrPolyline(), arrPt(2) Dim intPolyPoints, i, intDegree, intInterpolated Dim strPoly1 intPolyPoints = Rhino.GetInteger("How many points do you want on your polyline?", 6, 2 ) ' minimum number of points 2, no maximum. intDegree = Rhino.GetInteger("Spline = 0, Straight segments = 1", 1, 0, 1 ) ' minimum number of points 2, no maximum. intInterpolated = Rhino.GetInteger("Should the curve be interpolated Yes=1, No = 0", 1, 0, 1 ) ' An interpolated curve passes THROUGH the input points. ' A NON-interpolated curve uses the input points as the CONTROL POINTS of a spline, and the line may not pass through them!!! For i=0 To (intPolyPoints-1) 'This is a loop that makes all of the calculations for the points o the polyline. ReDim Preserve arrPolyline(i) ' This command allows you to change the number of points in an array dynamically arrPt(0) = Rhino.GetReal("X coordinate: " & i) ' this asks for input of the current X. arrPt(1) = Rhino.GetReal("Y coordinate: " & i) ' this asks for input of the current X. arrPt(2) = Rhino.GetReal("Z coordinate: " & i) ' this asks for input of the current X. arrPolyline(i) = arrPt ' this line combines all of the clicked points into an array. Next If IsArray(arrPolyline) Then If intDegree = 1 Then strPoly1 = Rhino.AddCurve (arrPolyline, 1) ' this line creates a polyline based on the array of chosen points. Else If intInterpolated = 1 Then strPoly1 = Rhino.AddInterpCurve (arrPolyline) ' as the default for Add curve is a degree 3 spline, anything other than degree 1 will be a curve. Else strPoly1 = Rhino.AddCurve (arrPolyline) End If End If End If End Sub