你好,再请教一下,参考你的示例,改写成vb.net代码,其中对象修改事件改成如下,但老是出错,不知道代码错在哪里,请帮忙看一下:
Private Sub m1ModiEvent(ByVal senderObj As Object, ByVal evtArgs As EventArgs)
Dim acDoc As Autodesk.AutoCAD.ApplicationServices.Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
Dim acCurDb As Database = acDoc.Database
Dim acDocEd As Autodesk.AutoCAD.EditorInput.Editor = acDoc.Editor
Dim mt As MText = CType(m1.MText.Clone(), MText)
mt.Contents = GetBzStr(m1.GetFirstVertex(0))
Using aclckdoc As DocumentLock = acDoc.LockDocument
Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
m1.UpgradeOpen()
m1.MText = mt ‘运行到这里,没有用,不能实现修改Mleader的文本功能,这是怎么回事?
acTrans.Commit()
End Using
End Using