« CADopia - AddItems method | Main | CADopia - AddLightWeightPolyline method »

Monday, November 26, 2007

CADopia - AddLeader method

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

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment