Sub ArrayPolar_Example()
' This example creates a line and a polar array based on that line.
Dim pt1(0 To 2) As Double: pt1(0) = 4: pt1(1) = 4: pt1(2) = 0
Dim pt2(0 To 2) As Double: pt2(0) = 7: pt2(1) = 1: pt2(2) = 0
Dim myLine As AcadLine
Set myLine = ThisDrawing.ModelSpace.AddLine(pt1, pt2)
myLine.Update
ThisDrawing.Application.ZoomExtents
Dim numOfObjects As Integer
Dim angleToFill As Double
Dim basePt(0 To 2) As Double
numOfObjects = 6
angleToFill = 4.72 ' =270 degrees
Dim ptBase(0 To 2) As Double
ptBase(0) = 4: ptBase(1) = 2: ptBase(2) = 0
' Create 6 copies of an object by rotating and copying it about the point (4,2,0).
Dim retObj As Variant
Set retObj = myLine.ArrayPolar(numOfObjects, angleToFill, ptBase)
retObj.Update
ThisDrawing.Application.ZoomExtents
MsgBox "Polar array constructed."
End Sub
Bricscad™ is commercialized by Bricsys NV. Bricsys NV and Vondle NV are fully owned subsidiaries of Menhirs NV. © 2001- Menhirs NV - All rights reserved. |