Option Explicit 'Script written by Russell Loveridge 'Script copyrighted by Call Main() ' this script makes the box tower, but while copying the objects up, it rotates them ' the first rotation is +'ve, then the next is -'ve... incrementally to create a dual twisting form. ' ' run this script first with a box 2x2x2 and use the default values. ' then SHADE the view for a simple contemporary architectural form. Sub Main() Dim strObject, StrObject2, dblSize, intDir, i, intCount, dblpos, dblRot, dblRotFinal Dim dblFlip : dblFlip = -1 ' this is the initial value for the dblFlip variable strObject = Rhino.GetObject( "Select an object to move" ) If IsNull(strObject) Then Exit Sub dblSize = Rhino.GetReal("floor height?", 1) dblRot = Rhino.GetReal("What degree of rotation between levels?", 2) If (VarType(dblRot) = vbNull Or (dblRot <= 0)) Then Exit Sub intDir = Rhino.GetInteger("Twist???: No=0, FLIP< =1", 1, 0, 1) ' this time the intDir value is used to determine the direction of rotation.... ClockWise:CW or CounterClockwisw :CCW ' The flip condition will rotate first in one direction, and then in the other... intCount = Rhino.GetInteger("how many copies?", 40) 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. ' this is the begining of our repeating FOR - NEXT loop..... For i = 1 To intCount ' in all cases the position of the copied cube is relative to the number of times (i) the loop has occured. dblpos = (i*dblSize) If intDir = 0 Then Rhino.CopyObject strObject, Array(0,0,0), Array(0,0,(dblpos*1.1)) Else ' rotate in random fliping direction.... dblFlip = (dblFlip *-1) ' for each LOOP dblFlip will toggle between +'ve, and -'ve.... dblRotFinal = (dblFlip *(dblRot *i)) strObject2= Rhino.CopyObject (strObject, Array(0,0,0), Array(0,0,(dblpos*1.1))) Rhino.RotateObject strObject2, Array(0,0,0), dblRotFinal End If Next End Sub