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);