给个简单的例子你看看吧
 - Sub k()
- Dim mtext As AcadMText
- Dim entry As AcadEntity
- Dim str1 As String
- Dim str2 As String
- Dim pickp As Variant
- 'On Error GoTo endp
- ThisDrawing.Utility.GetEntity entry, pickp, "select a mtext:"
- If entry.ObjectName = "AcDbMText" Then
- Set mtext = entry
- str1 = mtext.TextString
- MsgBox str1
- str3 = "mjtd.com"
- mtext.TextString = str3
- End If
|