<?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: UNDO via API in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/9981416#M14536</link>
    <description>&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Hi Kandennti-san,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have conducted some tests, but by any means, they were not intensive ones. Results…?&lt;/P&gt;&lt;P&gt;I would describe it them &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#800080"&gt;as mixed&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;. The text call function &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;trimHistoryStream()&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; undoubtedly performs &lt;EM&gt;&lt;STRONG&gt;UNDO-stack&lt;/STRONG&gt;&lt;/EM&gt; trimming.&lt;/P&gt;&lt;P&gt;It removes/deletes many entries there, but not all. I have noticed that for example &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;'Undo edit parameter'&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/EM&gt;and&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;'Undo Drive Joints'&lt;/STRONG&gt;&lt;/EM&gt; stay on the stack. Perhaps there are some other &lt;FONT color="#008000"&gt;&lt;EM&gt;&lt;STRONG&gt;non-trimmable items&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; also.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;The bodies created&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; during the scope of &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;trimHistoryStream()&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; operation &lt;FONT color="#FF00FF"&gt;&lt;EM&gt;&lt;STRONG&gt;become invisible !!!&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;. I have not to succeed &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF6600"&gt;lightBulb&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; on them using &lt;EM&gt;&lt;STRONG&gt;API&lt;/STRONG&gt;&lt;/EM&gt; call. &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;Scarry&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; think is that the&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt; bodies made outside&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; the scope of &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;trimHistoryStream()&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;become infected also !!!&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;. &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;They can be cured&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; by saving and opening the file though.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#808000"&gt;The reliability of the function is the open question&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;. Perhaps this is some &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#800080"&gt;try&amp;amp;error&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; attempt to address the underlaying issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would prefer more &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#800000"&gt;'common sense'&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; approach:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;establish a user-modifiable list of actions/transaction types to be pushed onto &lt;EM&gt;&lt;STRONG&gt;UNDO stack&lt;/STRONG&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;place a circular buffer at the entry of transactions into &lt;EM&gt;&lt;STRONG&gt;UNDO stack&lt;/STRONG&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;allow a user to determine the size of the buffer&lt;/LI&gt;&lt;LI&gt;filter transactions entering the buffer via the list in point 1&lt;/LI&gt;&lt;LI&gt;in the background purge the bottom of the stack by reasonable chunks&lt;/LI&gt;&lt;LI&gt;&lt;FONT color="#FF6600"&gt;&lt;EM&gt;&lt;STRONG&gt;and it is done!&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;EM&gt;&lt;STRONG&gt;For a person like you,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; I am &lt;FONT color="#00FF00"&gt;&lt;EM&gt;&lt;STRONG&gt;absolutely&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; sure that it would &lt;FONT color="#FF6600"&gt;&lt;EM&gt;&lt;STRONG&gt;need only a break between two sake shots to code it!&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Best Regards&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;MichaelT&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jan 2021 09:34:02 GMT</pubDate>
    <dc:creator>MichaelT_123</dc:creator>
    <dc:date>2021-01-06T09:34:02Z</dc:date>
    <item>
      <title>UNDO via API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/8636698#M14527</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Dear All In The Know,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color="#0000FF"&gt;of F360 On The Expert Level&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We all deal with residue issues every day. The common practice is to dispose&amp;nbsp;of the previous day dross and start a day fresh and light. This is a somehow instinctive process, which generally does not require manual intervention.&lt;/P&gt;
&lt;P&gt;In F360 we have &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;UNDO&lt;/FONT&gt;&lt;/STRONG&gt; facility which allows&amp;nbsp;us to conduct a similar function on our design's excesses/misadventures, but to my knowledge &lt;STRONG&gt;&lt;EM&gt;&lt;FONT color="#FF0000"&gt;only manually&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;You probably noticed that the bulkiness/length of &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;UNDO&lt;/STRONG&gt;&lt;/FONT&gt; list has a significant effect on design regeneration time. This is particularly the case while working on a complex/big project or/and using API script-driven processes on it. At least to be less general in the statement, it is my experience. Nevertheless, I anticipate that many users encounter similar phenomena.&amp;nbsp; Some more &lt;FONT color="#0000FF"&gt;&lt;EM&gt;fusionate&lt;/EM&gt;&lt;/FONT&gt; F360 aficionados&amp;nbsp;might even have their own benchmarking&amp;nbsp;tools to measure it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The question:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"Is there any API tool/function which would allow controlling/purging UNDO list?"&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I do not have to mention that...&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;EM&gt;&lt;FONT color="#993300"&gt;"The existence of such a process would be a great relief!"&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;do I?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;With Regards&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;MichaelT&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;PS.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;... without closing/re-opening a design.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2019 09:29:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/8636698#M14527</guid>
      <dc:creator>MichaelT_123</dc:creator>
      <dc:date>2019-03-05T09:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: UNDO via API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/8644688#M14528</link>
      <description>&lt;P&gt;There is no UNDO API available but there is a deleteMe API on objects which you can use to replicate the same behaviour but after that there is no way you can redo it.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 05:58:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/8644688#M14528</guid>
      <dc:creator>goyals</dc:creator>
      <dc:date>2019-03-08T05:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: UNDO via API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/8646925#M14529</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Hi Mr. Goyals,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the replay and... sorry to hear that &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;there is no relief in sight&lt;/STRONG&gt;&lt;/FONT&gt;. I will try to hold on using all means available to my disposal. It is not a comfortable&amp;nbsp;situation, but I hope that lax time will come.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As per your advice that &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;EM&gt;deleteMe&lt;/EM&gt;&lt;/STRONG&gt; &lt;EM&gt;"can use to replicate the same &lt;/EM&gt;behaviour&lt;EM&gt;"&lt;/EM&gt;,&lt;/FONT&gt; I allow myself to &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;disagree&lt;/STRONG&gt;&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;Many operations, which are recorded as transactions onto &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;EM&gt;UNDO&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt; list do not concern a deletable&amp;nbsp;object.&amp;nbsp;Some examples which come to mind are changes to appearances, modifications of parameters (both users and model/dimensions/formulas), modifications of features arguments values, timeline rearrangements, sketches modifications, and perhaps many more.&lt;/P&gt;
&lt;P&gt;They are not (unless they are the last changes/modifications) constituencies of design in time moment and particularly they are not saved when a document is closed. Re-opening the same document will result in an empty &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;EM&gt;UNDO&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt; list.&lt;/P&gt;
&lt;P&gt;Nevertheless, per my observation &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;EM&gt;UNDO&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt; list content/length/bulk has an effect on the design responsiveness/regeneration time as somehow the list is taking part in it. This negative effect can be quite pronounced, especially in a case of complex designs where multiple changes to it have been accumulated (into&amp;nbsp;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;EM&gt;UNDO&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt; list) and particularly exaggerated by side scripting processes of different natures.&lt;/P&gt;
&lt;P&gt;The detailed analysis of what happens is beyond me, as I observe the black box only, but even basic insight into the gastric tract of F360 by capable nurse/doctor should find the obstacle.&lt;/P&gt;
&lt;P&gt;The remedy could be quite simple :&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Limit the allowable depth of &lt;FONT color="#0000FF"&gt;&lt;EM&gt;&lt;STRONG&gt;UNDO&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; stack&lt;/LI&gt;
&lt;LI&gt;Build in the &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;UNDO flush button&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; ( or two allowing for an ecological half flush)&lt;/LI&gt;
&lt;LI&gt;Possibly expose it via API&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;FONT color="#FF00FF"&gt;&lt;STRONG&gt;&lt;EM&gt;On the nicer note&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;… let's imagine… changes have been made… the update released and…&lt;/P&gt;
&lt;P&gt;suddenly you start hearing the thunder of 24 deep relief's &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#993300"&gt;UFFFFFFFFsssss&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; with amplitude increasing every hour and finally the 25&lt;SUP&gt;th&lt;/SUP&gt; one, the loudest camming from SF.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;With Wishes of SSSuCCCeSSS&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;MichaelT&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Mar 2019 01:38:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/8646925#M14529</guid>
      <dc:creator>MichaelT_123</dc:creator>
      <dc:date>2019-03-09T01:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: UNDO via API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/8841077#M14530</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN class=""&gt;&lt;A id="link_23" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2900239" target="_self"&gt;MichaelT_123&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;Try this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;import adsk.core, adsk.fusion, traceback
def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface
        
        cmd = ui.commandDefinitions.itemById('UndoCommand')
        cmd.execute()

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class=""&gt;I found a way to call Fusion360's native commands.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&lt;A href="https://forums.autodesk.com/t5/fusion-360-api-and-scripts/api-for-working-with-selection-sets/m-p/8839242#M7987" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/fusion-360-api-and-scripts/api-for-working-with-selection-sets/m-p/8839242#M7987&lt;/A&gt;&lt;/SPAN&gt;&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>Sun, 09 Jun 2019 14:20:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/8841077#M14530</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2019-06-09T14:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: UNDO via API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/8841548#M14531</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Hi Mr. Kandennti,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The title of the post is short and I agree &lt;FONT color="#FF6600"&gt;it is not precise enough&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;The code you presented restores design&amp;nbsp;to a stage preceding the topmost transaction on &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;EM&gt;UNDO&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt; stack.&lt;/P&gt;&lt;P&gt;The problem I have tried to describe is of a different nature. It is about &lt;STRONG&gt;&lt;FONT color="#339966"&gt;&lt;EM&gt;How to remove the transaction entry from the UNDO stack without affecting a design itself&lt;/EM&gt;&lt;/FONT&gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I can understand that &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;messing up with history-based design&lt;/EM&gt;&lt;/FONT&gt;&lt;/STRONG&gt; paradigm can be quite challenging and could potentially open the &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;EM&gt;pandora’s box, unconstrained!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;. On the other side, it could also bring important benefits. The quite significant one would be the &lt;FONT color="#339966"&gt;&lt;STRONG&gt;&lt;EM&gt;increase the F360 processes responsiveness&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt; as the size of &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;EM&gt;UNDO&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt; stack (based on my experience and the recent evidence by &lt;STRONG&gt;&lt;EM&gt;Mr. JeromeBriot&lt;/EM&gt;&lt;/STRONG&gt; ( &lt;A href="https://forums.autodesk.com/t5/fusion-360-api-and-scripts/time-increase-when-a-script-is-executed-successively-on-the-same/td-p/8840341" target="_blank"&gt;https://forums.autodesk.com/t5/fusion-360-api-and-scripts/time-increase-when-a-script-is-executed-successively-on-the-same/td-p/8840341&lt;/A&gt;)) slows down F360 in many cases quite considerably.&lt;/P&gt;&lt;P&gt;As far as I know, currently there is only one way to purge/collapse &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;EM&gt;UNDO&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt; stack in a safe way. It is by invoking &lt;STRONG&gt;&lt;EM&gt;&amp;lt;&lt;FONT color="#0000FF"&gt;CloseFile&amp;gt;&amp;lt;OpenFile&amp;gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt; command pair. It is effective as it &lt;FONT color="#339966"&gt;&lt;STRONG&gt;&lt;EM&gt;clears UNDO stack&lt;/EM&gt;&lt;/STRONG&gt; &lt;/FONT&gt;and also &lt;FONT color="#339966"&gt;&lt;STRONG&gt;&lt;EM&gt;restores F360 responsiveness&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;, but in many scenarios is not a practical solution.&lt;/P&gt;&lt;P&gt;So there is the question… for &lt;STRONG&gt;&lt;EM&gt;DEVELOPERS&lt;/EM&gt;&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Would it be possible to wrap &lt;STRONG&gt;&lt;EM&gt;&amp;lt;&lt;FONT color="#0000FF"&gt;CloseFile&amp;gt;&amp;lt;OpenFile&amp;gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt; command pair into &lt;FONT color="#993300"&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;lt;FlushMePleaseAndForgetWhatYouHaveDoneSoFar&amp;gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;or potentially implement external parameter &lt;FONT color="#993300"&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;lt;FlushOrNotToFlush&amp;gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Regards&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;MichaelT&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 03:52:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/8841548#M14531</guid>
      <dc:creator>MichaelT_123</dc:creator>
      <dc:date>2019-06-10T03:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: UNDO via API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/9975614#M14532</link>
      <description>&lt;P&gt;I found TextCommands to delete Undo history.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Fusion.TrimHistoryStream&lt;/LI-CODE&gt;
&lt;P&gt;&lt;A href="https://github.com/kantoku-code/Fusion360_Small_Tools_for_Developers/blob/master/TextCommands/TextCommands_txt_Ver2_0_8176.txt#L704" target="_blank" rel="noopener"&gt;https://github.com/kantoku-code/Fusion360_Small_Tools_for_Developers/blob/master/TextCommands/TextCommands_txt_Ver2_0_8176.txt#L704&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a sample code that I actually tested.&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;#Fusion360API Python script
import adsk.core, adsk.fusion, traceback
import time
import tracemalloc

_app = adsk.core.Application.cast(None)
_ui = adsk.core.UserInterface.cast(None)

def run(context):
    try:
        useTrimHistory = True # &amp;lt;- Please change
        stepTrimHistory = 10 # &amp;lt;- Please change
        bodyCount = 100 # &amp;lt;- Please change

        global _app, _ui
        _app = adsk.core.Application.get()
        _ui = _app.userInterface
        _app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType)
        des  :adsk.fusion.Design = _app.activeProduct
        root :adsk.fusion.Component = des.rootComponent

        tracemalloc.start()
        t = time.time()
        dumpMsg(f'start - {log_memory()}')
        
        adsk.doEvents()

        bodies = initBoxes(bodyCount)

        baseFeatures = root.features.baseFeatures
        baseFeature = baseFeatures.add()
        rootBodies = root.bRepBodies
        for body in bodies:
            baseFeature.startEdit()
            rootBodies.add(body, baseFeature)
            baseFeature.finishEdit()
            dumpMsg(f'body count:{rootBodies.count}-{log_memory()}')
            adsk.doEvents()
            if (not rootBodies.count % stepTrimHistory) and useTrimHistory:
                _app.executeTextCommand(u'Fusion.TrimHistoryStream')

        dumpMsg(f'Done _ time:{time.time() - t}')
    except:
        _ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

def initBoxes(
    count) -&amp;gt; list:

    unitBox = 1

    pnt3D = adsk.core.Point3D
    vec3D = adsk.core.Vector3D
    pnt = pnt3D.create(0.0, 0.0, 0.0)
    lVec = vec3D.create(1.0, 0.0, 0.0)
    wVec= vec3D.create(0.0, 1.0, 0.0)

    bouBox3D = adsk.core.OrientedBoundingBox3D
    box = bouBox3D.create(pnt, lVec, wVec, unitBox, unitBox, unitBox)

    tmpBrMgr = adsk.fusion.TemporaryBRepManager.get()
    bodies = [tmpBrMgr.createBox(box) for idx in range(count)]

    return bodies

def dumpMsg(msg :str):
    global _ui
    _ui.palettes.itemById('TextCommands').writeText(str(msg))

def format_bytes(size):
	power = 2 ** 10  # 2**10 = 1024
	n = 0
	power_labels = ['B', 'KB', 'MB', 'GB', 'TB']
	while size &amp;gt; power and n &amp;lt;= len(power_labels):
		size /= power
		n += 1
	return 'used memory: {:.3f} {}'.format(size, power_labels[n])
 
def log_memory():
	snapshot = tracemalloc.take_snapshot()
	size = sum([stat.size for stat in snapshot.statistics('filename')])
	return format_bytes(size)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems to have a slight effect on processing speed.&lt;BR /&gt;However, there were times when the created Bodies were not displayed, though not every time.&lt;BR /&gt;I could not find a way to make them appear except to save the file and reopen it, which gave me an unstable impression.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2021 03:32:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/9975614#M14532</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2021-01-04T03:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: UNDO via API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/9975846#M14533</link>
      <description>&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF9900"&gt;You are&lt;/FONT&gt; &lt;/STRONG&gt;&lt;STRONG&gt;&lt;FONT color="#FF9900"&gt;The Legend&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;Kandenneti-san&lt;/STRONG&gt;&lt;/EM&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I haven't tested the code in more complex scenario yet, however I will let you know the result if I have performed it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Best Regards &amp;amp; HNY&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;MichaelT&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2021 07:30:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/9975846#M14533</guid>
      <dc:creator>MichaelT_123</dc:creator>
      <dc:date>2021-01-04T07:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: UNDO via API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/9978061#M14534</link>
      <description>&lt;P&gt;The reason why the body was hidden was that the state of the eye mark in the GUI and the isLightBulbOn property in the API were not the same.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.png" style="width: 538px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/862427i7A4C9DD152F86887/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;By setting isLightBulbOn=True in the API, we were able to restore the correct state.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, it seems that "Transaction.Trim" performs the same processing as "Fusion.TrimHistoryStream".&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 02:12:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/9978061#M14534</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2021-01-05T02:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: UNDO via API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/9978080#M14535</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Hi Kandennti-san,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It could be some transactional bug...&lt;/P&gt;&lt;P&gt;I hope that &lt;EM&gt;&lt;STRONG&gt;TF360&lt;/STRONG&gt;&lt;/EM&gt; take the notice and check it.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Regards&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;MichaelT&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 02:23:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/9978080#M14535</guid>
      <dc:creator>MichaelT_123</dc:creator>
      <dc:date>2021-01-05T02:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: UNDO via API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/9981416#M14536</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Hi Kandennti-san,&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have conducted some tests, but by any means, they were not intensive ones. Results…?&lt;/P&gt;&lt;P&gt;I would describe it them &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#800080"&gt;as mixed&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;. The text call function &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;trimHistoryStream()&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; undoubtedly performs &lt;EM&gt;&lt;STRONG&gt;UNDO-stack&lt;/STRONG&gt;&lt;/EM&gt; trimming.&lt;/P&gt;&lt;P&gt;It removes/deletes many entries there, but not all. I have noticed that for example &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;'Undo edit parameter'&lt;/FONT&gt; &lt;/STRONG&gt;&lt;/EM&gt;and&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;'Undo Drive Joints'&lt;/STRONG&gt;&lt;/EM&gt; stay on the stack. Perhaps there are some other &lt;FONT color="#008000"&gt;&lt;EM&gt;&lt;STRONG&gt;non-trimmable items&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; also.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;The bodies created&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; during the scope of &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;trimHistoryStream()&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; operation &lt;FONT color="#FF00FF"&gt;&lt;EM&gt;&lt;STRONG&gt;become invisible !!!&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;. I have not to succeed &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF6600"&gt;lightBulb&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; on them using &lt;EM&gt;&lt;STRONG&gt;API&lt;/STRONG&gt;&lt;/EM&gt; call. &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;Scarry&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; think is that the&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt; bodies made outside&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; the scope of &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;trimHistoryStream()&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;become infected also !!!&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;. &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;They can be cured&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; by saving and opening the file though.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#808000"&gt;The reliability of the function is the open question&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;. Perhaps this is some &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#800080"&gt;try&amp;amp;error&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; attempt to address the underlaying issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would prefer more &lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#800000"&gt;'common sense'&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt; approach:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;establish a user-modifiable list of actions/transaction types to be pushed onto &lt;EM&gt;&lt;STRONG&gt;UNDO stack&lt;/STRONG&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;place a circular buffer at the entry of transactions into &lt;EM&gt;&lt;STRONG&gt;UNDO stack&lt;/STRONG&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;allow a user to determine the size of the buffer&lt;/LI&gt;&lt;LI&gt;filter transactions entering the buffer via the list in point 1&lt;/LI&gt;&lt;LI&gt;in the background purge the bottom of the stack by reasonable chunks&lt;/LI&gt;&lt;LI&gt;&lt;FONT color="#FF6600"&gt;&lt;EM&gt;&lt;STRONG&gt;and it is done!&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;EM&gt;&lt;STRONG&gt;For a person like you,&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; I am &lt;FONT color="#00FF00"&gt;&lt;EM&gt;&lt;STRONG&gt;absolutely&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt; sure that it would &lt;FONT color="#FF6600"&gt;&lt;EM&gt;&lt;STRONG&gt;need only a break between two sake shots to code it!&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Best Regards&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;MichaelT&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 09:34:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/9981416#M14536</guid>
      <dc:creator>MichaelT_123</dc:creator>
      <dc:date>2021-01-06T09:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: UNDO via API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/9982188#M14537</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2900239"&gt;@MichaelT_123&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know almost nothing about Transaction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/kantoku-code/Fusion360_Small_Tools_for_Developers/blob/master/TextCommands/TextCommands_txt_Ver2_0_8176.txt#L2486" target="_blank" rel="noopener"&gt;https://github.com/kantoku-code/Fusion360_Small_Tools_for_Developers/blob/master/TextCommands/TextCommands_txt_Ver2_0_8176.txt#L2486&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This list is old, but the latest version seems to have a few more commands for Transaction.xxx.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There may also be something available for TestTransaction.xxx.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/kantoku-code/Fusion360_Small_Tools_for_Developers/blob/master/TextCommands/TextCommands_txt_Ver2_0_8176.txt#L2438" target="_blank" rel="noopener"&gt;https://github.com/kantoku-code/Fusion360_Small_Tools_for_Developers/blob/master/TextCommands/TextCommands_txt_Ver2_0_8176.txt#L2438&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can actually type this in TextCommands(Txt) and check it out.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Transaction　/?

TestTransaction /?&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to see all the commands, try this one.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;TextCommands.List /hidden&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 15:23:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/undo-via-api/m-p/9982188#M14537</guid>
      <dc:creator>kandennti</dc:creator>
      <dc:date>2021-01-06T15:23:28Z</dc:date>
    </item>
  </channel>
</rss>

