Message 1 of 4
Calling AutoCAD Commands Programmatically

Not applicable
03-31-2015
07:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have two short methods which are both meant to call AutoCAD's UNDO command and pass in different parameters. They are:
/// <summary>
/// Method to mark the current position of the AutoCAD program
/// </summary>
public static void MarkPosition()
{
doc.SendStringToExecute("_UNDO ", true, false, false);
doc.SendStringToExecute("_M ", true, false, false);
}
/// <summary>
/// Method to step AutoCAD back to the marked position
/// </summary>
public static void BigUndo()
{
doc.SendStringToExecute("_UNDO ", true, false, false);
doc.SendStringToExecute("_B ", true, false, false);
}
However, when I call them they do not run like I expect them to. I suspect that I am doing this completely wrong but do not know what the right approach is