AutoCAD .NET Command Flags can be categorized into two major groups, the primary flags and secondary ones.
The primary Command Flags have only two, Modal and Transparent.
The second Command Flags have quite a few:
UsePickSet
Redraw
Session
Interruptible
DocExclusiveLock
DocReadLock
NoInternalLock
NoPaperSpace
NoTileMode
NoPerspective
NoBlockEditor
ActionMacro
NoActionRecording
NoHistory
NoMultiple
NoUndoMarker
NoNewStack
NoOem
Defun
InProgress
Undefined
We are going to focus on one of the secondary command flags, CommandFlags.InProgress, in this post.
The following command has the CommandFlags.InProgress command flag specified.
/// <summary>
/// The command demonstrating the behavior of the NoNewStack command flag.
/// </summary>
[CommandMethod("CmdGroup1", "Command33", null, CommandFlags.Modal| CommandFlags.InProgress, null, "Acad2012NetDemoAddinCS.chm", "Command33")]
public void Command33_Method()
{
Editor ed = AcadApplication.DocumentManager.MdiActiveDocument.Editor;
try
{
//TODO: add your code below.
ed.WriteMessage("Command33 ran.");
}
catch (System.Exception ex)
{
Debug.WriteLine(ex.ToString());
ed.WriteMessage(ex.ToString());
}
}
The CommandFlags.InProgress command flag may indicate that the command can run inside of the progress of something else but we have not successfully found such a circumstance, thus the output will not be demonstrated here. When things are clearer in the future we will revisit this topic.
By the way, all the command definition code was generated automatically by using AutoCAD .NET Addin Wizard (AcadNetAddinWizard).
The following illustration shows where the CommandFlags.InProgress command flag is on the wizard page:
The leading edge AutoCAD .NET Addin Wizard (AcadNetAddinWizard) can create commands with any good combinations of all available CommandFlags optionally, flexibly, intelligently, and automatically.
Recent Comments