AutoCAD.NET API exposes “Application.Quit()” to exit the AutoCAD. However, “Application.Quit()” at present is unable to save all the user profile setting (like active ribbon tab ). One alternative approach for the issue is to use quit AutoCAD command through “SendStringToExecute”
[CommandMethod("quitACAD", CommandFlags.Session)] static public void quitACAD() { //Quit AutoCAD Application.DocumentManager.MdiActiveDocument.SendStringToExecute("quit ", true, false, true); }