dcount107 发表于 2006-7-19 21:03:00

请高手帮忙分析!

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

dcount107 发表于 2006-7-20 14:32:00

<P>再如:</P>
<P>ThisDrawing.SendCommand "(command ""Move"" ent """" pt pause)" &amp;vbcr</P>
<P>msgbox "JumpHere"</P>
<P>如果在移动过程中按下中键进行PAN操作,程序马上会跳转到MSGBOX,不解!</P>

雪山飞狐_lzh 发表于 2006-7-20 16:36:00

<P>SendCommand方法本来就不推荐使用,该方法Bug太多</P>

dcount107 发表于 2006-7-20 20:07:00

<P>郁闷,不用SendCommand的话就实现不了移动(或拷贝)时预览图像,看以前的帖子好像也没有得到好的解决办法。</P>
<P>还是改学OBJECTARX算了,^_^!</P>
页: [1]
查看完整版本: 请高手帮忙分析!