MexicanCustard 发表于 2016-9-12 23:01:13


我想也许AutoCAD正在将命令包装在某种事务中?与去除纤维有关???现在只是猜测....

dgorsman 发表于 2016-9-13 00:02:57


和……一样吗
很抱歉,我看到了与xys1995相同的行为,它会一次性将其打印到命令行
您可以始终使用
邪恶
事件

公共静态void nn()
{
编辑器ed=Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
用于(int i=0;i
{
ed.WriteMessage(“\n{0}”,i)
线程睡眠(500)
System.Windows.Forms.Application.DoEvents()
}
}

xys1995 发表于 2016-9-13 07:17:00

请记住您在使用AutoCAD时在UI线程上的工作。因此,直到代码中有暂停,即用户输入,DoEvents()。您不会看到任何命令行更新。 它看起来像你试图向用户展示某种更新。我是否可以建议ProgressMeter()。 它并不完美,但AutoCAD在操作之间更新它做得很好。

kdub 发表于 2016-9-13 10:27:25


Me认为AutoCAD可能将命令包装在某种事务中?跟去除纤维有关吗???现在只能猜测....

我怀疑这是对命令行面板进行更改以支持可点击命令选项和其他新功能的副作用。

xys1995 发表于 2016-9-13 22:09:28


很有意思。
      
      public static void nn()
      {
            Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
            int totalTimes = 10;
            ProgressMeter pm = new ProgressMeter();
            pm.SetLimit(totalTimes);
            pm.Start();
            for (int i = 0; i < totalTimes; i++)
            {
                pm.MeterProgress();
                Thread.Sleep(1000);
                //ed.WriteMessage("\n{0}", i);
                //System.Windows.Forms.Application.DoEvents();
            }
            pm.Stop();
      }
页: 1 [2]
查看完整版本: 编辑器如何立即显示消息& # 65311;