<?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: When running a Python Script, Fusion goes into &amp;quot;Not Responding&amp;quot; mode until the script finishes in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/when-running-a-python-script-fusion-goes-into-quot-not/m-p/12668692#M1768</link>
    <description>&lt;P&gt;If you could post your script, that would be very helpful. In a script that takes significant time to execute, it's important to give Fusion a chance to do its work. Usually, this is done with calls to&amp;nbsp;&lt;STRONG&gt;adsk.doEvents&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeff&lt;/P&gt;</description>
    <pubDate>Wed, 27 Mar 2024 09:46:33 GMT</pubDate>
    <dc:creator>jeff.pek</dc:creator>
    <dc:date>2024-03-27T09:46:33Z</dc:date>
    <item>
      <title>When running a Python Script, Fusion goes into "Not Responding" mode until the script finishes</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/when-running-a-python-script-fusion-goes-into-quot-not/m-p/12667978#M1766</link>
      <description>&lt;P&gt;Despite my script having a progress report that should update every second, and output to the TextCommandPallette, the script will run for several seconds before groups of output and the latest Progress are displayed and the Fusion UI (including the cancel button in the Progress Window) is unresponsive until the script completes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script creates a sketch and then draws a rectangle and several hundred (maybe upwards of 3000) small line segments and creates a number of "multiline" text objects (which actually only contain 1-2 characters).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The eventual intent of the script is to be a generator for DXF files that can be used to laser cut a variety of rulers in wood or acrylic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code frequently checks for the cancel button being clicked, which I thought should return control to the UI briefly to sample the cancel button at least, but it seems like Fusion is basically stuck in a wait() for the Python script to finish (I don't know if that is what is actually happening).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script is long, but I can post it if people feel it is necessary to identify the problem/solution. I'm hoping someone is already familiar with this behavior and its resolution from the description.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 01:22:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/when-running-a-python-script-fusion-goes-into-quot-not/m-p/12667978#M1766</guid>
      <dc:creator>owendelong</dc:creator>
      <dc:date>2024-03-27T01:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: When running a Python Script, Fusion goes into "Not Responding" mode until the script finishes</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/when-running-a-python-script-fusion-goes-into-quot-not/m-p/12667979#M1767</link>
      <description>&lt;P&gt;I should add this is on a Mac.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 01:22:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/when-running-a-python-script-fusion-goes-into-quot-not/m-p/12667979#M1767</guid>
      <dc:creator>owendelong</dc:creator>
      <dc:date>2024-03-27T01:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: When running a Python Script, Fusion goes into "Not Responding" mode until the script finishes</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/when-running-a-python-script-fusion-goes-into-quot-not/m-p/12668692#M1768</link>
      <description>&lt;P&gt;If you could post your script, that would be very helpful. In a script that takes significant time to execute, it's important to give Fusion a chance to do its work. Usually, this is done with calls to&amp;nbsp;&lt;STRONG&gt;adsk.doEvents&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeff&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 09:46:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/when-running-a-python-script-fusion-goes-into-quot-not/m-p/12668692#M1768</guid>
      <dc:creator>jeff.pek</dc:creator>
      <dc:date>2024-03-27T09:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: When running a Python Script, Fusion goes into "Not Responding" mode until the script finishes</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/when-running-a-python-script-fusion-goes-into-quot-not/m-p/12670319#M1769</link>
      <description>&lt;P&gt;Let me try adding calls to adsk.doEvents and see if that resolves it. If that works, I'll note it in a reply and mark that as an accepted solution. If not, I'll post the script. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 19:05:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/when-running-a-python-script-fusion-goes-into-quot-not/m-p/12670319#M1769</guid>
      <dc:creator>owendelong</dc:creator>
      <dc:date>2024-03-27T19:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: When running a Python Script, Fusion goes into "Not Responding" mode until the script finishes</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/when-running-a-python-script-fusion-goes-into-quot-not/m-p/12670373#M1770</link>
      <description>&lt;P&gt;That solved the problem, indeed. This should be included in more of the example code and explained better in the documentation, IMHO.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 19:25:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/when-running-a-python-script-fusion-goes-into-quot-not/m-p/12670373#M1770</guid>
      <dc:creator>owendelong</dc:creator>
      <dc:date>2024-03-27T19:25:50Z</dc:date>
    </item>
  </channel>
</rss>

