欢迎加我的QQ群:193522571,一起来讨论、交流!

AutoCAD.Net/C#.Net QQ群:193522571 C# ^C^C模拟,中止当前命令执行下一个命令

        private void sendcmd(string sCmd)
        {
            Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
            string esc = "";
            string cmds = (string)AcadApp.GetSystemVariable("CMDNAMES");
            if (cmds.Length > 0)
            {
                int cmdNum = cmds.Split(new char[] { '\'' }).Length;
                for (int i = 0; i < cmdNum; i++)
                    esc += '\x03';
            }
            doc.SendStringToExecute(esc + "_." + sCmd + " ", true, false, false);
        }

 

doc.SendStringToExecute("\u001b\u001b" + sCmd + "\n", false, false, true);
posted @ 2019-09-05 09:17  swtool  阅读(528)  评论(0编辑  收藏  举报
欢迎加我的QQ群:193522571,一起来讨论、交流!