Option Explicit 'Script written by Russell Loveridge 'Script copyrighted by Call Main() ' this script introduces scaling into the last "twist" example. ' as the objects are copied upwards they are scaled in XY to become progressively smaller. ' this creates a tapering effect for the tower. Sub Main() Dim strObject, StrObject2, dblSize, intDir, i, intCount, dblpos strObject = Rhino.GetObject( "Select an object to move" ) If IsNull(strObject) Then Exit Sub dblSize = Rhino.GetReal("floor height?", 2) intDir = Rhino.GetInteger("Twist???: No=0, CW=1, CCW=2, random=3", 0, 0, 3) intCount = Rhino.GetInteger("how many copies?", 12) If (VarType(intCount) = vbNull Or (intCount <= 0)) Then Exit Sub ' we can use the user input value and multiply it by a random factor between 0 and 1. For i = 1 To intCount dblpos = (i*dblSize) If intDir = 0 Then Rhino.CopyObject strObject, Array(0,0,0), Array(0,0,(dblpos*1.1)) strObject2=Rhino.LastObject Rhino.ScaleObject strObject2, Array(0,0,0), array((1-(i/(intCount*2))),(1-(i/(intCount*2))),1) ' Scale parameters: SCALE - identifier, centerpoint, array of XYZ values for scaling ' remember that: 'Scale=0 is 0% = deleted 'scale=0.5 is 50% = HALF SIZE 'scale=1 is 100% = NO CHANGE 'scale=2 is 200% = DOUBLE SIZE ElseIf intDir = 1 Then strObject2= Rhino.CopyObject (strObject, Array(0,0,0), Array(0,0,(dblpos*1.1))) Rhino.ScaleObject strObject2, Array(0,0,0), array((1-(i/(intCount*2))),(1-(i/(intCount*2))),1) Rhino.RotateObject strObject2, Array(0,0,0), (-10*i) ElseIf intDir = 2 Then strObject2= Rhino.CopyObject (strObject, Array(0,0,0), Array(0,0,(dblpos*1.1))) Rhino.ScaleObject strObject2, Array(0,0,0), array((1-(i/(intCount*2))),(1-(i/(intCount*2))),1) Rhino.RotateObject strObject2, Array(0,0,0), (10*i) Else strObject2= Rhino.CopyObject (strObject, Array(0,0,0), Array(0,0,(dblpos*1.1))) Rhino.ScaleObject strObject2, Array(0,0,0), array((rnd*(1-(i/(intCount*2)))),(1-(i/(intCount*2))),1) Rhino.RotateObject strObject2, Array(0,0,0), ((rnd*10)*i) End If Next End Sub