<?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: Cancelling any running commands in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/cancelling-any-running-commands/m-p/2803980#M63377</link>
    <description>&lt;P&gt;Thanks cadMeUp but I've already had a go at the sendstringtoexecute too. (sorry should've mentioned that)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The button on my form asks the user to select a block or blocks in the drawing but if I do sendstringtoexecute it seems to get there too late and actually cancels my getselection instead of cancelling whatever's running then doing&amp;nbsp;my getselection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need something that's going to run synchronously.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for your effort though.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Oct 2010 16:06:30 GMT</pubDate>
    <dc:creator>Paulio</dc:creator>
    <dc:date>2010-10-21T16:06:30Z</dc:date>
    <item>
      <title>Cancelling any running commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/cancelling-any-running-commands/m-p/2803374#M63373</link>
      <description>&lt;P&gt;I'm trying to figure out&amp;nbsp;essentially how to send a few escape key presses to AutoCAD when I run a procedure in my code to make sure that nothing else is running.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's ok if I run my command from a palette as I just preceed the command string with ^c^c which is fine. The code I'm running gets kicked off by a button press on a modeless form though so in theory the user could be halfway through doing anything in AutoCAD when they click my button.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought about using acedPostCommand as suggested in Kean's blog here:&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" rel="nofollow" href="http://through-the-interface.typepad.com/through_the_interface/2006/08/cancelling_an_a.html"&gt;http://through-the-interface.typepad.com/through_the_interface/2006/08/cancelling_an_a.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem with that is that there are (or seem to be) different entry points for 32 and 64 bit so I don't know how to declare the function so it will work. I need my app to work on either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I thought I'd try Tony T's commandline thing; the problem with that is that I can't seem to figure out&amp;nbsp;how to pass it what I want. I need to pass it chr(27) but can't get it to work. Am I just being thick? (don't answer that)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This must have come up before but I can't find anything or anyone who's done it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2010 08:35:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cancelling-any-running-commands/m-p/2803374#M63373</guid>
      <dc:creator>Paulio</dc:creator>
      <dc:date>2010-10-21T08:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cancelling any running commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/cancelling-any-running-commands/m-p/2803494#M63374</link>
      <description>&lt;P&gt;You can check the Document.CommandInProgress()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is using COM&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&amp;nbsp;              &lt;SPAN style="color: #2b91af;"&gt;Document&lt;/SPAN&gt;&amp;nbsp;doc&amp;nbsp;=&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;Application&lt;/SPAN&gt;.DocumentManager.MdiActiveDocument;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: #2b91af;"&gt;AcadDocument&lt;/SPAN&gt;&amp;nbsp;acadDoc&amp;nbsp;=&amp;nbsp;(&lt;SPAN style="color: #2b91af;"&gt;AcadDocument&lt;/SPAN&gt;)doc.AcadDocument;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;acadDoc.SendCommand(&lt;SPAN style="color: #a31515;"&gt;"\x03\x03"&lt;/SPAN&gt;);&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Oct 2010 11:54:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cancelling-any-running-commands/m-p/2803494#M63374</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-10-21T11:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Cancelling any running commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/cancelling-any-running-commands/m-p/2803566#M63375</link>
      <description>&lt;P&gt;Thanks for that, but is there any way to do it without COM?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2010 12:43:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cancelling-any-running-commands/m-p/2803566#M63375</guid>
      <dc:creator>Paulio</dc:creator>
      <dc:date>2010-10-21T12:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Cancelling any running commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/cancelling-any-running-commands/m-p/2803928#M63376</link>
      <description>&lt;P&gt;You can trying something like the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Autodesk.AutoCAD.Internal.PreviousInput.CommandLineMonitorServices comLineMonServ =&lt;BR /&gt;&amp;nbsp;Autodesk.AutoCAD.Internal.PreviousInput.CommandLineMonitorServices.Instance();&lt;BR /&gt;foreach (Document doc in AcadApp.DocumentManager)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;if (doc == AcadApp.DocumentManager.MdiActiveDocument)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;continue;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Autodesk.AutoCAD.Internal.PreviousInput.CommandLineMonitor comMon = comLineMonServ.GetCommandLineMonitor(doc);&lt;BR /&gt;&amp;nbsp;if(comMon.CurrentCommandName.Length != 0)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;doc.SendStringToExecute("\x03\x03", false, true, false);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure if it will work on 64bit?, I'm on 32&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2010 15:43:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cancelling-any-running-commands/m-p/2803928#M63376</guid>
      <dc:creator>cadMeUp</dc:creator>
      <dc:date>2010-10-21T15:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cancelling any running commands</title>
      <link>https://forums.autodesk.com/t5/net-forum/cancelling-any-running-commands/m-p/2803980#M63377</link>
      <description>&lt;P&gt;Thanks cadMeUp but I've already had a go at the sendstringtoexecute too. (sorry should've mentioned that)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The button on my form asks the user to select a block or blocks in the drawing but if I do sendstringtoexecute it seems to get there too late and actually cancels my getselection instead of cancelling whatever's running then doing&amp;nbsp;my getselection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need something that's going to run synchronously.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for your effort though.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2010 16:06:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cancelling-any-running-commands/m-p/2803980#M63377</guid>
      <dc:creator>Paulio</dc:creator>
      <dc:date>2010-10-21T16:06:30Z</dc:date>
    </item>
  </channel>
</rss>

