<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Application idle event handler used to run undo command results in an eInvalidInput error in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/application-idle-event-handler-used-to-run-undo-command-results/m-p/10773307#M14524</link>
    <description>&lt;P&gt;I searched again and found a couple of threads pointing in the correct direction. It is not possible to use Editor.Command in an application context. So I tried SendStringToExecute, which is working.&lt;/P&gt;</description>
    <pubDate>Mon, 22 Nov 2021 11:30:25 GMT</pubDate>
    <dc:creator>ChristianBlei</dc:creator>
    <dc:date>2021-11-22T11:30:25Z</dc:date>
    <item>
      <title>Application idle event handler used to run undo command results in an eInvalidInput error</title>
      <link>https://forums.autodesk.com/t5/net-forum/application-idle-event-handler-used-to-run-undo-command-results/m-p/10771951#M14523</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I try to "undo" the previous command be running an editor command "undo" in an application idle event. I get an eInvalidInput error.&lt;/P&gt;
&lt;P&gt;What is the reason for this error and is there a way to avoid it?&lt;/P&gt;
&lt;P&gt;I attached the handler inside of&amp;nbsp; a database_modified eventhandler where I check if I want to use the "undo".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;private static void AcApplication_Idle(object sender, EventArgs e)&lt;BR /&gt;{&lt;BR /&gt;AcApplication.DocumentManager.MdiActiveDocument.Editor.Command("_.undo", "1");&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for helping!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 15:01:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/application-idle-event-handler-used-to-run-undo-command-results/m-p/10771951#M14523</guid>
      <dc:creator>ChristianBlei</dc:creator>
      <dc:date>2021-11-21T15:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Application idle event handler used to run undo command results in an eInvalidInput error</title>
      <link>https://forums.autodesk.com/t5/net-forum/application-idle-event-handler-used-to-run-undo-command-results/m-p/10773307#M14524</link>
      <description>&lt;P&gt;I searched again and found a couple of threads pointing in the correct direction. It is not possible to use Editor.Command in an application context. So I tried SendStringToExecute, which is working.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 11:30:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/application-idle-event-handler-used-to-run-undo-command-results/m-p/10773307#M14524</guid>
      <dc:creator>ChristianBlei</dc:creator>
      <dc:date>2021-11-22T11:30:25Z</dc:date>
    </item>
  </channel>
</rss>

