Gets the bulge value at a given index of the polyline.
Supported platforms: Windows only
VBA:
RetVal = object.GetBulge(Index)
Type: LWPolyline, Polyline
The objects this method applies to.
Access: Input-only
Type: Integer
The index location of the vertex you wish to query. The index must be a positive integer beginning with zero.
Type: Double
The bulge value for the vertex at the given index.
Polyline: this method will fail if the polyline Type property is not acSimplePoly.
The bulge is the tangent of 1/4 of the included angle for the arc between the selected vertex and the next vertex in the polyline's vertex list. A negative bulge value indicates that the arc goes clockwise from the selected vertex to the next vertex. A bulge of 0 indicates a straight segment, and a bulge of 1 is a semicircle.
VBA:
Sub Example_GetBulge()
' This example creates a lightweight polyline in model space.
' It then finds and changes the bulge for a given segment.
Dim plineObj As AcadLWPolyline
Dim points(0 To 11) As Double
' Define the 2D polyline points
points(0) = 1: points(1) = 1
points(2) = 1: points(3) = 2
points(4) = 2: points(5) = 2
points(6) = 3: points(7) = 2
points(8) = 4: points(9) = 4
points(10) = 4: points(11) = 1
' Create a lightweight Polyline object in model space
Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
ZoomAll
' Find the bulge of the third segment
Dim currentBulge As Double
currentBulge = plineObj.GetBulge(3)
MsgBox "The bulge for the third segment is " & plineObj.GetBulge(3), , "GetBulge Example"
' Change the bulge of the third segment
plineObj.SetBulge 3, -0.5
plineObj.Update
MsgBox "The bulge for the third segment is now " & plineObj.GetBulge(3), , "GetBulge Example"
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_GetBulge()
;; This example creates a lightweight polyline in model space.
;; It then finds and changes the bulge for a given segment.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Define the 2D polyline points
(setq points (vlax-make-safearray vlax-vbDouble '(0 . 11)))
(vlax-safearray-fill points '(1 1
1 2
2 2
3 2
4 4
4 1
)
)
;; Create a lightweight Polyline object in model space
(setq modelSpace (vla-get-ModelSpace doc))
(setq plineObj (vla-AddLightWeightPolyline modelSpace points))
(vla-ZoomAll acadObj)
;; Find the bulge of the third segment
(setq currentBulge (vla-GetBulge plineObj 3))
(alert (strcat "The bulge for the third segment is " (rtos (vla-GetBulge plineObj 3) 2)))
;; Change the bulge of the third segment
(vla-SetBulge plineObj 3 -0.5)
(vla-Update plineObj)
(alert (strcat "The bulge for the third segment is now " (rtos (vla-GetBulge plineObj 3) 2)))
)