<?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: Set up Fusion360 Python APIs in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/11326119#M14240</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In other thread, I used &lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-BA2FAC2C-74C8-4F89-8AC4-DAFFD6790A83" target="_blank" rel="noopener"&gt;DataFile.isComplete&lt;/A&gt;&amp;nbsp;instead of&amp;nbsp;future.uploadState in the waiting loop to check for the upload status of the file.&lt;/P&gt;&lt;P&gt;What I found is that future.uploadState were not updated when the file was ready.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jorge&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jul 2022 14:51:27 GMT</pubDate>
    <dc:creator>Jorge_Jaramillo</dc:creator>
    <dc:date>2022-07-28T14:51:27Z</dc:date>
    <item>
      <title>Set up Fusion360 Python APIs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8773642#M14226</link>
      <description>&lt;P&gt;I recently posted a&amp;nbsp;&lt;A href="https://forums.autodesk.com/t5/fusion-360-api-and-scripts/convert-sldprt-files-to-stl-using-fusion360-python-api/td-p/8765694" target="_blank" rel="noopener"&gt;question&lt;/A&gt;&amp;nbsp;online on how to convert .sldprt file to .stl and I was advised to use the cloud environment by Fusion360 (answer by &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6746157"&gt;@JesusFreke&lt;/a&gt;&amp;nbsp;and &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5741855"&gt;@BrianEkins&lt;/a&gt;&amp;nbsp;). However, since I am a complete beginner, I have no idea where to start and how to install the Python Libraries (and which libraries to install to make sure I am able to achieve the conversion). Can anyone guide me where to start.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 17:10:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8773642#M14226</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-06T17:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Fusion360 Python APIs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8773720#M14227</link>
      <description>&lt;P&gt;You don't need to install anything. Fusion comes bundled with its own Python IDE that you can use to create, edit and run scripts.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get started, you can follow the walkthrough at&amp;nbsp;&lt;A href="http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-9701BBA7-EC0E-4016-A9C8-964AA4838954" target="_blank"&gt;http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-9701BBA7-EC0E-4016-A9C8-964AA4838954&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 17:35:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8773720#M14227</guid>
      <dc:creator>JesusFreke</dc:creator>
      <dc:date>2019-05-06T17:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Fusion360 Python APIs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8773734#M14228</link>
      <description>&lt;P&gt;Here's a previous response of mine to a similar question that contains some code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/fusion-360-api-and-scripts/how-to-programmatically-import-local-fusion-file-to-fusion/m-p/7112300?advanced=false&amp;amp;collapse_discussion=true&amp;amp;filter=location&amp;amp;location=forum-board:22&amp;amp;q=uploadFile&amp;amp;search_type=thread" target="_blank"&gt;https://forums.autodesk.com/t5/fusion-360-api-and-scripts/how-to-programmatically-import-local-fusion-file-to-fusion/m-p/7112300?advanced=false&amp;amp;collapse_discussion=true&amp;amp;filter=location&amp;amp;location=forum-board:22&amp;amp;q=uploadFile&amp;amp;search_type=thread&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 17:44:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8773734#M14228</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2019-05-06T17:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Fusion360 Python APIs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8773735#M14229</link>
      <description>&lt;P&gt;Thanks for your response. I will install Fusion360 and get going.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 17:44:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8773735#M14229</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-06T17:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Fusion360 Python APIs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8773878#M14230</link>
      <description>&lt;P&gt;Thanks for help&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5741855"&gt;@BrianEkins&lt;/a&gt;&amp;nbsp;. I did get a chance to look over the code. However, I still can't seem to figure out the proper flow of code. So I have a single .sldprt file which I want to convert to .stl. I have installed Fusion 360, I have run the first script (Hello Script) as guided by&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6746157"&gt;@JesusFreke&lt;/a&gt;&amp;nbsp;. However, how to I proceed next. My though process is as follows:&lt;/P&gt;
&lt;P&gt;1) Import the file into the script&lt;/P&gt;
&lt;P&gt;2) Upload it to the Autodesk cloud&lt;/P&gt;
&lt;P&gt;3) Tell Autodesk somehow to convert the uploaded (.sldprt) file to .slt.&lt;/P&gt;
&lt;P&gt;4) Download the converted .sldprt file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I don't know exactly how to do it (the Python code). I did get a chance to look at your code but I believe it imports an f3d instad of .sldprt. Plus, it assumes that I would have an autodesk 360 project folder (I only have an input .sldprt file).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry for my lack of understanding, this is my second day working on Fusion360 and its associated APIs. Can you guide me in the right direction as to how to achieve all the above mentioned 4 steps I wrote about.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 18:46:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8773878#M14230</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-06T18:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Fusion360 Python APIs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8774069#M14231</link>
      <description>&lt;P&gt;The workflow in your case will be to upload the SLDPRT file using the Folder.uploadFile method that's demonstrated in the post I referenced earlier.&amp;nbsp; That uploads the file and begins the translation on the cloud.&amp;nbsp; The uploadFile method returns a DataFileFuture object.&amp;nbsp; After the upload, the file is on the queue to be translated but you don't know when that will happen.&amp;nbsp; The DataFileFuture object lets you check on the status of the translation.&amp;nbsp; Once it's complete you can access the associated DataFile object that represents the F3D file that was created from the SLDPRT file.&amp;nbsp; You can then use the Documents.open method to open that DataFile locally in Fusion.&amp;nbsp; Finally, you can now use the local STL translator in Fusion to export the design as an STL file.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 20:14:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8774069#M14231</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2019-05-06T20:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Fusion360 Python APIs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8774076#M14232</link>
      <description>&lt;P&gt;Thanks a lot for the detailed explanation. This does makes sense. I will try that out and let you know how that worked out.&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2019 20:18:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8774076#M14232</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-06T20:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Fusion360 Python APIs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8776183#M14233</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5741855"&gt;@BrianEkins&lt;/a&gt;, I tried using the methodology you suggested earlier. However I am running into an error when I try to open the converted .f3d file on my computer locally. I have included an image of error and my code. Is it possible for you to take a look at it and see what the problem is? I am following the exact methodology you explained in the answer to another link.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ErrorA360.JPG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/633988i0867EA6056BB3E2C/image-size/large?v=v2&amp;amp;px=999" role="button" title="ErrorA360.JPG" alt="ErrorA360.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 16:04:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8776183#M14233</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-07T16:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Fusion360 Python APIs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8776267#M14234</link>
      <description>&lt;P&gt;I just tested it too and it looks like there is a bug in the Fusion API.&amp;nbsp; The DataFile object being returned is bad.&amp;nbsp; Either the underlying data the object represents isn't fully ready or it's just returning a bad object.&amp;nbsp; This will need to be fixed by the Fusion 360 team.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used a workaround in the code below to use the API to get the DataFile object again and this seems to work, at least in my small testing.&amp;nbsp; I'm still not sure if the original DataFile returned is bad or not yet ready because getting it again could either be getting a good object or it's just delaying long enough for it to be ready.&amp;nbsp; Another problem though is that it's displaying the upload dialog, which it shouldn't be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;def run(context):
    try:
        app = adsk.core.Application.get()
        ui = app.userInterface

        # Upload the Solidworks part.
        proj = app.data.activeProject
        folder = proj.rootFolder
        future = folder.uploadFile('C:\\Temp\\UPPER BASE.SLDPRT')
        
        startTime = time.time()
        while future.uploadState == adsk.core.UploadStates.UploadProcessing:
            time.sleep(1)
            adsk.doEvents()
            if time.time() - startTime &amp;gt; 60:
                ui.messageBox('Aborting.  Translation is taking longer than 2 minutes.')
                return
            
        if future.uploadState == adsk.core.UploadStates.UploadFailed:
            ui.messageBox('Upload failed.')
            return
        elif future.uploadState == adsk.core.UploadStates.UploadFinished:
            # There's a bug that the DataFile return isn't valid.  This gets it
            # again.
            badDataFile = future.dataFile
            files = folder.dataFiles
            file = adsk.core.DataFile.cast(None)
            goodDataFile = None
            for file in files:
                if file.name == badDataFile.name:
                    goodDataFile = file
                    break
                
            doc = app.documents.open(goodDataFile, True)            
            ui.messageBox('Successfully translated the file.')
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 May 2019 16:29:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8776267#M14234</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2019-05-07T16:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Fusion360 Python APIs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8776307#M14235</link>
      <description>&lt;P&gt;I believe it is returning a bad object. I tried the code you wrote above but I get the same error in line&amp;nbsp;&lt;/P&gt;
&lt;P&gt;doc = app.documents.open(goodDataFile, True).&lt;/P&gt;
&lt;P&gt;For me, the upload file dialog pops up at random (1 in 5 times approximately).&lt;/P&gt;
&lt;P&gt;Moreover, The loop which has one minute wait time never times out, and the file gets uploaded before one minute. That makes me think a bad object is returned. I am a bit confused as to why it is working on your system.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 16:48:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8776307#M14235</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-07T16:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Fusion360 Python APIs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8776324#M14236</link>
      <description>&lt;P&gt;Wait, your code seems to work! It displays the file in Fusion360 now. Not sure why it gave me an error when I tried it out the first time. I will start working on the last part (Importing a .stl file using the import manager. )&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 16:57:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8776324#M14236</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-07T16:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Fusion360 Python APIs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8776346#M14237</link>
      <description>&lt;P&gt;I'm not sure how reliable it will be.&amp;nbsp; The behavior is flaky and there definitely is a bug that needs to be fixed on the Fusion side.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 17:08:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8776346#M14237</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2019-05-07T17:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Fusion360 Python APIs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8776354#M14238</link>
      <description>&lt;P&gt;You are right. I did eventually accomplish the task, the script inputs a .sldprt file and outputs a .stl file. Currently, I am trying out with different file formats. I just wanted to thank you for all your help and support, without which it wouldn't have been possible.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2019 17:14:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/8776354#M14238</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-07T17:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Fusion360 Python APIs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/11325581#M14239</link>
      <description>&lt;P&gt;Could you please share your code. I am facing some issue.&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 10:46:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/11325581#M14239</guid>
      <dc:creator>s.chand6RXFT</dc:creator>
      <dc:date>2022-07-28T10:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Set up Fusion360 Python APIs</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/11326119#M14240</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In other thread, I used &lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-BA2FAC2C-74C8-4F89-8AC4-DAFFD6790A83" target="_blank" rel="noopener"&gt;DataFile.isComplete&lt;/A&gt;&amp;nbsp;instead of&amp;nbsp;future.uploadState in the waiting loop to check for the upload status of the file.&lt;/P&gt;&lt;P&gt;What I found is that future.uploadState were not updated when the file was ready.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jorge&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 14:51:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/set-up-fusion360-python-apis/m-p/11326119#M14240</guid>
      <dc:creator>Jorge_Jaramillo</dc:creator>
      <dc:date>2022-07-28T14:51:27Z</dc:date>
    </item>
  </channel>
</rss>

