<?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 How to use Child Transactions (Undo and Redo)? in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-use-child-transactions-undo-and-redo/m-p/9289439#M105292</link>
    <description>&lt;P&gt;My add-in displays a window, and I wrap everything that happens while the window is open into a single transaction. This is working fine. However, I want to build undo/redo &lt;EM&gt;within&lt;/EM&gt; the window. I thought I could accomplish this using child transactions, but I can't seem to figure out how they work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've read this article:&amp;nbsp;&lt;A href="https://adndevblog.typepad.com/manufacturing/2012/07/how-nested-transactions-undo-and-abort-work-in-inventor.html" target="_blank" rel="noopener"&gt;How Nested Transactions, Undo and Abort Work in Inventor?&lt;/A&gt;, but it doesn't demonstrate how to use child transactions, just explains the concept. I've played around with child transactions and checkpoints, as discussed in the article, but I can't get it to work right.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me demonstrate what I'm after with a workflow example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Window opens, Main transaction is started&lt;UL&gt;&lt;LI&gt;User clicks "Command A"&lt;UL&gt;&lt;LI&gt;Child transaction "A" is started&lt;/LI&gt;&lt;LI&gt;Changes are made&lt;/LI&gt;&lt;LI&gt;Child transaction is ended&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;User clicks "Command "B"&lt;UL&gt;&lt;LI&gt;Child transaction "B" is started&lt;/LI&gt;&lt;LI&gt;Changes are made&lt;/LI&gt;&lt;LI&gt;Child transaction is ended&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;User hits the "Undo" button.&amp;nbsp;&lt;FONT color="#FF0000"&gt;How do I undo everything that happened within child transaction "B"?&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;User hits the "Redo" button. &lt;FONT color="#FF0000"&gt;How do I re-do everything that happened within child transaction "B"?&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, I've only managed to roll back changes within a transaction using checkpoints, but then there's no possibility of a redo. The rolled-back work is gone forever.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, how can I undo/redo child transactions just like we can with parent transactions? And if it's not possible, what even is the point of child transactions?&lt;/P&gt;</description>
    <pubDate>Fri, 31 Jan 2020 21:16:49 GMT</pubDate>
    <dc:creator>DRoam</dc:creator>
    <dc:date>2020-01-31T21:16:49Z</dc:date>
    <item>
      <title>How to use Child Transactions (Undo and Redo)?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-use-child-transactions-undo-and-redo/m-p/9289439#M105292</link>
      <description>&lt;P&gt;My add-in displays a window, and I wrap everything that happens while the window is open into a single transaction. This is working fine. However, I want to build undo/redo &lt;EM&gt;within&lt;/EM&gt; the window. I thought I could accomplish this using child transactions, but I can't seem to figure out how they work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've read this article:&amp;nbsp;&lt;A href="https://adndevblog.typepad.com/manufacturing/2012/07/how-nested-transactions-undo-and-abort-work-in-inventor.html" target="_blank" rel="noopener"&gt;How Nested Transactions, Undo and Abort Work in Inventor?&lt;/A&gt;, but it doesn't demonstrate how to use child transactions, just explains the concept. I've played around with child transactions and checkpoints, as discussed in the article, but I can't get it to work right.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me demonstrate what I'm after with a workflow example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Window opens, Main transaction is started&lt;UL&gt;&lt;LI&gt;User clicks "Command A"&lt;UL&gt;&lt;LI&gt;Child transaction "A" is started&lt;/LI&gt;&lt;LI&gt;Changes are made&lt;/LI&gt;&lt;LI&gt;Child transaction is ended&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;User clicks "Command "B"&lt;UL&gt;&lt;LI&gt;Child transaction "B" is started&lt;/LI&gt;&lt;LI&gt;Changes are made&lt;/LI&gt;&lt;LI&gt;Child transaction is ended&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;User hits the "Undo" button.&amp;nbsp;&lt;FONT color="#FF0000"&gt;How do I undo everything that happened within child transaction "B"?&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;User hits the "Redo" button. &lt;FONT color="#FF0000"&gt;How do I re-do everything that happened within child transaction "B"?&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, I've only managed to roll back changes within a transaction using checkpoints, but then there's no possibility of a redo. The rolled-back work is gone forever.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, how can I undo/redo child transactions just like we can with parent transactions? And if it's not possible, what even is the point of child transactions?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 21:16:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/how-to-use-child-transactions-undo-and-redo/m-p/9289439#M105292</guid>
      <dc:creator>DRoam</dc:creator>
      <dc:date>2020-01-31T21:16:49Z</dc:date>
    </item>
  </channel>
</rss>

