Option Explicit 'Script written by 'Script copyrighted by 'Script version Monday, September 29, 2008 3:33:22 PM Call Main() Sub Main() Dim i,j,k,m Dim strTarget, strCurv, strObject, arrPts, dblNum, arrptStart, arrBox, dblDist, dblRatio, arrpttarg Dim arrptCent, strNewObj, arrDist strObject=Rhino.GetObject("select object to copy") strCurv=Rhino.GetObject("select curve",4) strTarget=Rhino.GetObject("select target",1) arrpttarg=rhino.PointCoordinates(strtarget) dblNum=Rhino.GetReal("number of copies",10) dblRatio=rhino.GetReal("scale factor",2) arrBox=Rhino.BoundingBox(strObject) arrptCent=FpointCentroid(arrBox) arrPts=Rhino.DivideCurve(strCurv,dblNum) For i=0 To Ubound(arrPts) dblDist=rhino.Distance(arrPts(i),arrpttarg) dblDist=(100/dblDist)*dblRatio strNewObj=Rhino.CopyObject(strObject,arrptCent,arrPts(i)) arrDist=Array(dblDist,dblDist,dblDist) rhino.ScaleObject strNewObj,arrPts(i),arrDist Next End Sub Function FpointCentroid(arrPoints) 'this function returns an aray of point coordinates at the centroid of an array of points Dim arrCent(2),i, j arrCent(0)=0 arrCent(1)=0 arrCent(2)=0 For i=0 To Ubound(arrPoints) arrCent(0)=arrCent(0) + arrPoints(i)(0) arrCent(1)=arrCent(1) + arrPoints(i)(1) arrCent(2)=arrCent(2) + arrPoints(i)(2) Next j=i+1 FpointCentroid=Array((arrCent(0)/i),(arrCent(1)/i),(arrCent(2)/i)) End Function