Editor.Command and Pause token issue

Editor.Command and Pause token issue

mariusCDZWL
Explorer Explorer
577 Views
1 Reply
Message 1 of 2

Editor.Command and Pause token issue

mariusCDZWL
Explorer
Explorer

I am trying to invoke POLYLINE command with overriden angle synchronously.

        [CommandMethod("TestPoly")]
        public static void Test()
        {
            Application.DocumentManager.MdiActiveDocument.Editor.Command("_.PLINE", Editor.PauseToken, "<100", Editor.PauseToken);
        }

This works perfectly fine, however if I cancel POLYLINE command with ESC, next time when I try to use the same "TestPoly" command it throws "eInvalidInput" exception.

cKuZ2X9xCs.gif

Is this an API issue or am I doing something wrong?

0 Likes
578 Views
1 Reply
Reply (1)
Message 2 of 2

ActivistInvestor
Mentor
Mentor

That looks like a bug. You might try calling the command method with no arguments before calling it with arguments.

 

More generally, pausing for input has never been considered a reliable way to script AutoCAD.