Change text of leader note

Change text of leader note

hieut1392
Enthusiast Enthusiast
322 Views
2 Replies
Message 1 of 3

Change text of leader note

hieut1392
Enthusiast
Enthusiast

I want to change the existing content of a leader note with the content I specify by clicking. Can anyone help me?

0 Likes
Accepted solutions (1)
323 Views
2 Replies
Replies (2)
Message 2 of 3

norman.yuan
Mentor
Mentor
Accepted solution

To clarify, are you talking a "Leader" entity, or "MLeader"? Assume it is MLeader, you can simply reach AcadMLeader.TextString property:

 

Option Explicit

Public Sub GetMLeaderContent()
    
    Dim pt As Variant
    Dim ent As AcadEntity
    Dim mleader As AcadMLeader
    Dim leaderText As String
    
    On Error Resume Next
    ThisDrawing.Utility.GetEntity ent, pt, vbCr & "Select a MLeader object:"
    If ent Is Nothing Then Exit Sub
    If TypeOf ent Is AcadMLeader Then
        Set mleader = ent
        leaderText = mleader.TextString
        MsgBox "MLeader's content: " & leaderText
    Else
        MsgBox "No an MLeader object!"
    End If
    
End Sub

 

 

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 3

hieut1392
Enthusiast
Enthusiast

Thanks for respone

0 Likes