Option Explicit 'Script written by Russell Loveridge 'Script copyrighted by Call Main() ' this is a copy command - with a built in loop to make the copy happen multiple times. Sub Main() Dim strObject, dblSize, intDir, i, intCount, dblpos strObject = Rhino.GetObject( "Select an object to copy" ) If IsNull(strObject) Then Exit Sub dblSize = Rhino.GetReal("enter distance to copy the object", 2) intDir = Rhino.GetInteger("direction to move the object: X=0, Y=1, Z=2, all=3", 3, 0, 3) intCount = Rhino.GetInteger("how many copies of the object do you want?") If (VarType(intCount) = vbNull Or (intCount <= 0)) Then Exit Sub 'This is a FOR LOOP,... it set a conditional statement, and as long as it is TRUE it will loop. For i = 1 To intCount ' i is our counter number - each time the loop REPEATS it is increased by 1. first loop i=0, second i=2,... and so on. ' intCount is the LIMIT for the number of loops,... if intCout = 5, the process will loop 5 times, if intCount = 10 it will loop 10 times. ' the loop will continue until i is no longer SMALLER than intCout dblpos = (i*dblSize) ' here we are using the counter to increase the distance that the object is moved each time the process loops. If intDir = 0 Then 'copy in X Rhino.CopyObject strObject, Array(0,0,0), Array(dblPos,0,0) ElseIf intDir = 1 Then 'copy in Y Rhino.CopyObject strObject, Array(0,0,0), Array(0,dblpos,0) ElseIf intDir = 2 Then 'copy in Z Rhino.CopyObject strObject, Array(0,0,0), Array(0,0,dblpos) Else 'copy and move in all three directions at once.... Rhino.CopyObject strObject, Array(0,0,0), Array(dblpos,dblpos,dblpos) End If ' close the IF statement ' we show the end of the loop by using the NEXT command... this is where the loop returns to the FOR section above. Next End Sub