ArrayPolar method example

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: numOfObjects = 6
    Dim angleToFill As Double: 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).
    myLine.ArrayPolar numOfObjects, angleToFill, ptBase
    ThisDrawing.Application.ZoomExtents
    MsgBox "Polar array constructed."
End Sub

© Bricsys NV. All rights reserved.