<?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 Cancel Command when switching documents in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/cancel-command-when-switching-documents/m-p/9889866#M17888</link>
    <description>&lt;P&gt;If I have an active command that is in the midst of a transaction when switching documents (say inserting a block) how do I ensure that transaction is closed before the switch occurs?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a counter that monitors opened and closed transactions and it triggers a warning when I do.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Nov 2020 18:37:31 GMT</pubDate>
    <dc:creator>SRSDS</dc:creator>
    <dc:date>2020-11-23T18:37:31Z</dc:date>
    <item>
      <title>Cancel Command when switching documents</title>
      <link>https://forums.autodesk.com/t5/net-forum/cancel-command-when-switching-documents/m-p/9889866#M17888</link>
      <description>&lt;P&gt;If I have an active command that is in the midst of a transaction when switching documents (say inserting a block) how do I ensure that transaction is closed before the switch occurs?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a counter that monitors opened and closed transactions and it triggers a warning when I do.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 18:37:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cancel-command-when-switching-documents/m-p/9889866#M17888</guid>
      <dc:creator>SRSDS</dc:creator>
      <dc:date>2020-11-23T18:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Cancel Command when switching documents</title>
      <link>https://forums.autodesk.com/t5/net-forum/cancel-command-when-switching-documents/m-p/9891337#M17889</link>
      <description>&lt;P&gt;The document switch can only occurs when you're using an interactive method like Editor.Getxxx(). In this case, the returned status will be PromptStatus.Cancel. You can then commit your transaction (if it is what you mean by "close the transaction").&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;PromptPointResult result = editor.GetPoint("\nInsertion point: ");
if (result.Status == PromptStatus.Cancel) 
{
  transaction.Commit();
  // Note: the transaction need to be disposed, you have to put it in an using.
  return;
}&lt;/LI-CODE&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 24 Nov 2020 08:56:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cancel-command-when-switching-documents/m-p/9891337#M17889</guid>
      <dc:creator>FRFR1426</dc:creator>
      <dc:date>2020-11-24T08:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Cancel Command when switching documents</title>
      <link>https://forums.autodesk.com/t5/net-forum/cancel-command-when-switching-documents/m-p/9891464#M17890</link>
      <description>&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Thankyou. You're right, it does complete the code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;DocumentToBeDeactivated handler executes then it reverts to finish. Which I didn't realise.&lt;/P&gt;&lt;P&gt;I need to adjust my transaction count error warnings for that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2020 09:45:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cancel-command-when-switching-documents/m-p/9891464#M17890</guid>
      <dc:creator>SRSDS</dc:creator>
      <dc:date>2020-11-24T09:45:45Z</dc:date>
    </item>
  </channel>
</rss>

