Option Explicit 'Script written by Luis Gil 'Script copyrighted by www.legil.org 'Script creates a number of random points within a given field and writes a .txt file with coordinates 'in qHull format. TXT file can then be directly read in qhull for whatever. Call randomPoints() Sub randomPoints() Dim intNumPoints, intXparameter, intYparameter, intZparameter intNumPoints = Rhino.GetInteger("How many points?", 100, 1) intXparameter = Rhino.GetInteger("Maximum X value?", 10, 1) intYparameter = Rhino.GetInteger("Maximum Y value?", 10, 1) intZparameter = Rhino.GetInteger("Maximum Z value?", 10, 1) ReDim arrPoints(intNumPoints - 1) Dim i Call Rhino.EnableRedraw(False) For i = LBound(arrPoints) To UBound(arrPoints) Dim x : x = Rnd() * intXparameter Dim y : y = Rnd() * intYparameter Dim z : z = Rnd() * intZparameter arrPoints(i) = Array(x, y, z) Rhino.AddPoint(arrPoints(i)) Rhino.Print(arrPoints(i)(0) & " " & arrPoints(i)(1) & " " & arrPoints(i)(2)) Next Call Rhino.EnableRedraw(True) ''----------------------------------------------------- ''this is the .txt file writing portion. it is disabled. set where you want the file to be written ''and what you want it to be called then uncomment the block below to have the script write the file. ''----------------------------------------------------- 'Dim filesys, testfile 'Set filesys = CreateObject("Scripting.FileSystemObject") 'Set testfile= filesys.CreateTextFile("c:/users/render/documents/pointsForQhull.txt", True) ''this is where you set the path 'testfile.WriteLine "3" 'testfile.WriteLine (intNumPoints) 'For j = LBound(arrPoints) To UBound(arrPoints) ' testfile.WriteLine((arrPoints(j)(0) & " " & arrPoints(j)(1) & " " & arrPoints(j)(2))) 'Next 'testfile.Close End Sub