Cancel active command C#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
although I've seen many questions and answers on this subject none of them works for me except this one:
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.SendStringToExecute("\x03\x03", false, true, false);
but it runs asynchronously and that is not what I want.
Some answers that I found and tried out are more than 10 years old so I guess maybe they used to work on older version of CAD but now they don't.
So to be clear, I need a way to cancel any active command synchronously, using C# and I work in AutoCAD 2018.
I tried to use the Editor.Command() and Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication;.ActiveDocument.SendCommand(), but i don't know what string to pass. Tried so many without success.
Please help, this is driving me crazy.