Creates a leader and adds it to the drawing.
Syntax
objectVariable = object.AddLeader(Points, Annotation, type)
Where:
objectVariable is a Leader object;
object is one of the ModelSpace or PaperSpace collection objects or a Block object;
Points is a collection of points defining the leader line;
Annotation is a String of text or a dimension to be associated with the leader;
type is a Long integer representing one of the following LeaderType constants:
0 LeaderLineWithNoArrow
1 LeaderLineWithArrow
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 CADopia.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
Comments