AddLightWeightPolyline method example

Sub AddLightWeightPolyline_Example()
' This example adds a lightweight polyline to the drawing.
    Dim myLWP As AcadLWPolyline
    'LWpolyline expects an array of 2D OCS coordinates (only x and y)
    Dim myPoints(0 To 5) As Double
    myPoints(0) = 0: myPoints(1) = 0
    myPoints(2) = 3: myPoints(3) = 0
    myPoints(4) = 3: myPoints(5) = 4
    Set myLWP = ThisDrawing.ModelSpace.AddLightWeightPolyline(myPoints)
    myLWP.Closed = True
    myLWP.Update
    ThisDrawing.Application.ZoomExtents
End Sub

© Bricsys NV. All rights reserved.