Option Explicit 'Script written by Russell Loveridge 'Script copyrighted by Call Main() Sub Main() 'declare the variables for the script. Dim strObject, dblSize, intDir, dblMove 'user input - identify the object to move strObject = Rhino.GetObject( "Select an object to move" ) If IsNull(strObject) Then Exit Sub ' user input (a "double" is a real number ex: 3.1459) dblSize = Rhino.GetReal("enter Maximum distance to move the box", 10) ' user input (an "integer" is a whole number ex: 4 - no decimal fraction) intDir = Rhino.GetInteger("direction to move the box: X=0, Y=1, Z=2", 0, 0, 2) ' the numbers at the end of this statement are limiters, this means: ' ask the user for a number, Default num=0, min num=0, max num = 2 dblMove = (rnd*dblSize) ' ' This is a conditional statement: It allows for multiple choices. ' in all of the below cases - the object will move a random value between 0 and the input distance value. ' this will be the ACTUAL value that the box is moved by... random from 0-1 multiplied by the input distance. dblMove = (rnd*dblSize) ' we do the calculation here - and assign it to the variable "dblMove" so that we are able to PRINT it to the command line. Rhino.print "the random value for the move distance is: "& dblMove ' Here we send a message of text (between the " marks) & the value of the variable dblMove. If intDir = 0 Then Rhino.MoveObject strObject, Array(0,0,0), Array(dblMove,0,0) ' this is the move if the user inputs 0 - for an X move ElseIf intDir = 1 Then Rhino.MoveObject strObject, Array(0,0,0), Array(0,dblMove,0) ' this is the move if the user inputs 1 - for an Y move Else Rhino.MoveObject strObject, Array(0,0,0), Array(0,0,dblMove) ' this is the move if the user inputs 2 - for an Z move End If End Sub