AddLeader method example

Private 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 myDoc As IntelliCAD.Document

     Dim myLeader As Leader

     Dim myPoints As Points

     Dim pt As Point

     Set myDoc = ActiveDocument

     Set myPoints = Library.CreatePoints

     Set pt = Library.CreatePoint(1, 3, 0)

     myPoints.Add

     myPoints(myPoints.Count).x = pt.x

     myPoints(myPoints.Count).y = pt.y

     myPoints(myPoints.Count).z = pt.z

     Set pt = Library.CreatePoint(3, 4, 0)

     myPoints.Add

     myPoints(myPoints.Count).x = pt.x

     myPoints(myPoints.Count).y = pt.y

     myPoints(myPoints.Count).z = pt.z

     Set myLeader = ThisDocument.ModelSpace.AddLeader(myPoints, "testldr", 2)

     myLeader.Update

End Sub