Editor's Command method
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to create a button that, when pressed, marks the position of the drawing. Right now the method looks like this.
[CommandMethod("MARKPOS", CommandFlags.Session)]
public void MarkPosition()
{
Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
ed.Command("UNDO", "M");
}
However, when I try and execute the method I get the error pictured below and cannot determine why.
************** Exception Text **************
Autodesk.AutoCAD.Runtime.Exception: eInvalidInput
at Autodesk.AutoCAD.EditorInput.Editor.Command(Object[] parameter)
at AutoCAD_Adapter.MyCommands.MarkPosition() in c:\Users\nickg\Documents\All Code\autocad-adapter\IOAutoCADHandler\myCommands.cs:line 186
at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.PerDocumentCommandClass.Invoke(MethodInfo mi, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke()
|