以下代码用于递增文字, 现在的问题是:如果MBUTTONPAN为1的话,程序执行到sendComand语句中时,只要一按下中键,程序就出现死循环!请高手帮忙分析!万分感谢!
On Error Resume Next TxtAdd_Form.Hide
Dim Ent As AcadEntity Dim EntDes As AcadEntity Dim basepnt As Variant Dim TextObj As AcadText Dim TextObjCopy As AcadText ThisDrawing.Utility.GetEntity Ent, basepnt, "请选择起始的文字" If Ent.ObjectName <> "AcDbText" Then GoTo Over Ent.Highlight True TextSource = Ent.textString 'MsgBox TextSource Add: TextAdd
Set TextObj = Ent.Copy TextObj.textString = TextMod 'ThisDrawing.SetVariable "MBUTTONPAN", 0 ThisDrawing.SendCommand "(ManualInsert """ + TextObj.handle + """)" & vbCr Ent.Highlight False GoTo Add: Over: |