I am trying to write two methods that call the AutoCAD UNDO command and pass different parameters. The first method calls UNDO and passes M, which means marking the position of the drawing. The second method calls UNDO and passes B, which means the cancellation is completely back to the marked position (or the end if it is absent). So far they are pretty simple.
/// <summary> /// Method to mark the current position of the AutoCAD program /// </summary> public static void MarkPosition() { doc.SendStringToExecute("._UNDO M", true, false, true); } /// <summary> /// Method to step AutoCAD back int steps /// </summary> public static void BigUndo() { doc.SendStringToExecute("._UNDO B", true, false, true); }
They look as if they should work, but for some reason they do not. When I call MarkPosition () and then BigUndo (), I get the error "Start of group"; enter Undo End to go back. To check my syntax. I changed MarkPosition to
public static void MarkPosition() { doc.SendStringToExecute("circle 2,2,0 4 ", true, false, true); }
which successfully draws a circle. This means that my syntax is right, but something strange is happening with Undo.
source share