/// <summary>
/// Sends the command via SendStringToExecute
/// To preserve pickfirst, cancel only if there is an active command.
/// </summary>
/// <param name="cmd">The command to send.</param>
public static void Send(string cmd)
{
Document doc = CAD_App.DocumentManager.MdiActiveDocument;
if (doc == null) return;
// gotta have a space at the end.
if (!cmd.EndsWith(" ")) cmd += " ";
// check for active command
int activeCmd = Convert.ToInt32(CAD_App.GetSystemVariable("CMDACTIVE"));
if (activeCmd > 0)
{
// cancel out of it
doc.SendStringToExecute("\x03\x03", false, true, false);
}
// now send the command we want
doc.SendStringToExecute(cmd, false, true, false);
}