Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (25 sloc) 997 Bytes
' ArrayPolar.rvb -- October 2008
' If this code works, it was written by Dale Fugier.
' If not, I don't know who wrote it.
' Works with Rhino 4.0.
Option Explicit
Sub ArrayPolar
Dim arrObjects, arrCenter, nCount
Dim dAngle, arrAxis, arrXform, i
arrObjects = Rhino.GetObjects("Select objects to array")
If IsNull(arrObjects) Then Exit Sub
arrCenter = Rhino.GetPoint("Center of polar array")
If IsNull(arrCenter) Then Exit Sub
nCount = Rhino.GetInteger("Number of items",,2)
If IsNull(nCount) Then Exit Sub
dAngle = 360.0 / nCount
Rhino.EnableRedraw False
For i = 1 To nCount - 1
arrAxis = Array(0,0,1) ' world z-axis
arrXform = Rhino.XformRotation(dAngle * i, arrAxis, arrCenter)
Rhino.TransformObjects arrObjects, arrXform, True
Rhino.EnableRedraw True
End Sub
Something went wrong with that request. Please try again.