Option Explicit 'Script written by Russell Loveridge 'Script copyrighted by RAL:lapa.epfl.ch 'This script makes a polyline based on user input - clicking onscreen points - . ' this script is not so useful for drawing, but it demonstrates how to make arrays of points, and then use them to create a line. Call Makepolyline() Sub Makepolyline() Dim arrPolyline(), arrPt Dim intPolyPoints, i, intDegree 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. 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 = Rhino.GetPoint("Pick a point") ' this asks the user to click points on the screen. 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 strPoly1 = Rhino.AddCurve (arrPolyline) ' as the default for Add curve is a degree 3 spline, anything other than degree 1 will be a curve. End If End If End Sub