Option Explicit
‘Script written by ben howell (w/Marc Fornes)
‘Script copyrighted by md+x (w/ Marc Fornes)
‘Script version Saturday, October 06, 2007 11:19:09 PM

Call Main()
Sub Main()

Dim arrMeshes : arrMeshes = rhino.getObjects(“pick boat parts”,32)

Dim intLow : intLow = 0
Dim intUp : intUp = 100

Dim arrVerticesNewOrigin()

Dim i
Dim n: n = 0

‘ ===========================
For i = 0 To UBound(arrMeshes)

‘Dim arrCentPt : arrCentPt = Rhino.MeshAreaCentroid(arrMesh)
Dim arrVertices : arrVertices = Rhino.MeshVertices(arrMeshes(i))

If IsArray(arrVertices) Then

If i > 0 Then

Dim arrMovedObject : arrMovedObject = Rhino.MoveObjects (array(arrMeshes(i)), arrVertices(0), array(i,0,0) )
‘Dim arrMovedObject : arrMovedObject = Rhino.MoveObjects (array(arrMeshes(i)), arrVertices(0), arrVerticesNewOrigin(i-1) )
‘Rhino.RotateObject arrMesh, newArrVertices(t), (dblDistance* (rnd()*10))

Dim arrVerticesMoved : arrVerticesMoved = Rhino.MeshVertices(arrMovedObject(0))
If isArray(arrVerticesMoved) Then
ReDim Preserve arrVerticesNewOrigin(i)
arrVerticesNewOrigin(i) = arrVerticesMoved(2)
n = n+1
End If


ReDim Preserve arrVerticesNewOrigin(0)
arrVerticesNewOrigin(0) = arrVertices(0)

End If

End If
‘ ===========================
‘ Rhino.EnableRedraw(True)
End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s