Length/Closed Properties example
Sub Length_Closed_Example()
Dim myLWP As AcadLWPolyline
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
MsgBox "The length of the new polyline is: " & myLWP.Length
MsgBox "The Closed property is: " & myLWP.Closed
myLWP.Closed = False
myLWP.Update
MsgBox "The length of the polyline is: " & myLWP.Length
MsgBox "The Closed property is: " & myLWP.Closed
End Sub
© Bricsys NV. All rights reserved. |