Adds a leader line to the leader cluster with specified index.
Supported platforms: Windows only
VBA:
RetVal = object.AddLeaderLine(leaderIndex, pointArray)
Type: MLeader
The object this method applies to.
Access: Input-only
Type: Long
The index of the leader cluster where the new leader line is to be added. Index must be a positive integer.
Access: Input-only
Type: Variant (three-element array of doubles)
The 3D OCS coordinates at which to create the new leader line.
Type: Long
The index of the added leader line.
No additional remarks.
VBA:
Sub Example_MLeaderLine() Dim oML As AcadMLeader Dim points(0 To 5) As Double points(0) = 1: points(1) = 1: points(2) = 0 points(3) = 4: points(4) = 4: points(5) = 0 Dim i As Long Set oML = ThisDrawing.ModelSpace.AddMLeader(points, i) Dim r As Long r = oML.AddLeader() points(4) = 10 Call oML.AddLeaderLine(r, points) MsgBox "LeaderCount = " & oML.LeaderCount ZoomExtents End Sub
Visual LISP:
(vl-load-com) (defun c:Example_MLeaderLine() (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (setq points (vlax-make-safearray vlax-vbDouble '(0 . 5))) (vlax-safearray-fill points '(1 1 0 4 4 0 ) ) (setq i 0) (setq modelSpace (vla-get-ModelSpace doc)) (setq oML (vla-AddMLeader modelSpace points i)) (setq r (vla-AddLeader oML)) (vlax-safearray-put-element points 4 10) (vla-AddLeaderLine oML r points) (alert (strcat "LeaderCount = " (itoa (vla-get-LeaderCount oML)))) (vla-ZoomExtents acadObj) )