VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change text of leader note

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
hieut1392
137 Views, 2 Replies

Change text of leader note

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

2 REPLIES 2
Message 2 of 3
norman.yuan
in reply to: hieut1392

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
in reply to: hieut1392

Thanks for respone

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report