Identify the running command in document using AutoCAD.NET

By Virupaksha Aithal
You can use “Autodesk.AutoCAD.ApplicationServices.Document” class’s property “CommandInProgress” to identify the running command name inside a document. This string is always returns the English command name.

Document doc = Autodesk.AutoCAD.ApplicationServices.
          Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
 
string str = doc.CommandInProgress;
 
if (str != "")
{
    ed.WriteMessage(str + "n");
}
else
{
    ed.WriteMessage("No command is running" + "n");
}

Comments

One response to “Identify the running command in document using AutoCAD.NET”

  1. Hi Virupaksha,
    When “selecting” objects is active it doesn’t seem to identify it as a command. Is it right?
    Thanks,

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading