AddLeader method example


Sub Leader_Example()
' This example adds a point entity to the drawing using the AddLeader
' method. A type 2 leader (line w/ arrow is used).
    Dim oMtext As AcadMText
    Dim ptMtext(0 To 2) As Double
    ptMtext(0) = 20: ptMtext(1) = 10: ptMtext(2) = 0
    Set oMtext = ThisDrawing.ModelSpace.AddMText(ptMtext, 1, "Text for annotation")
    Dim myLeader As AcadLeader
    Dim myPoints(0 To 8) As Double
    myPoints(0) = 0: myPoints(1) = 0: myPoints(2) = 0
    myPoints(3) = 4: myPoints(4) = 7: myPoints(5) = 0
    myPoints(6) = 20: myPoints(7) = 10: myPoints(8) = 0
    Set myLeader = ThisDrawing.ModelSpace.AddLeader(myPoints, oMtext, acLineWithArrow)
    myLeader.Update
    ThisDrawing.Application.ZoomExtents
End Sub

© Bricsys NV. All rights reserved.