GetBulge method example


Sub GetBulge_Example()
' This example adds a polyline to the drawing.
' It then uses the GetBulge method to obtain the bulge factor
' and the SetBulge to change it.
    Dim myLWP As AcadLWPolyline
    'LWpolylines 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
    Dim currentBulge As Double
    currentBulge = myLWP.GetBulge(2)
    MsgBox "The bulge for the second segment is " & currentBulge, , "Get/SetBulge example "
    ' Change the bulge of the 2nd segment
    myLWP.SetBulge 2, 1.3
    myLWP.Update
    MsgBox "The bulge for the second segment is now " & myLWP.GetBulge(2), , "Get/SetBulge Example "
End Sub

© Bricsys NV. All rights reserved.