Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to save as USD file with API

4 REPLIES 4
Reply
Message 1 of 5
ruk.shan
179 Views, 4 Replies

How to save as USD file with API

There is a way to export STL files with API "utils.export_stl(app, save_dir)"  . Is there a similar way to save as USD files ?
4 REPLIES 4
Message 2 of 5
Rushikesh.kadam
in reply to: ruk.shan

@ruk.shan Here is a link that shows how to export to USD format using API. 

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-78B91813-88C3-4777-AEC2-19F5FB438ED2

 

------------------------------------------------------------------------------------------------------------------------------

If my reply was helpful, please click the "Accept as Solution" button. It helps others get the answer quickly! A "Like" is always welcomed.




Rushikesh Kadam
Senior QA Engineer
Quality Assurance
Autodesk, Inc.


Message 3 of 5
ruk.shan
in reply to: Rushikesh.kadam

Great. Thank you so much
Message 4 of 5

Hi,

With this function you can export the currently open design:

 

def exportToUSD():
    try:
        global _app, _ui

        exportMgr = adsk.fusion.ExportManager.cast(_app.activeProduct.exportManager)
        usdOptions = exportMgr.createUSDExportOptions(tempfile.gettempdir() + "/test.usd")
        return(f'export to USD was: {exportMgr.execute(usdOptions)}')

    except:
        if _ui:
            _ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
        return(f'error exporting to {tempfile.gettempdir() + "/test.usd"}')

Regards,

Jorge

 

Message 5 of 5
hclmed
in reply to: Jorge_Jaramillo

Thanks for this example. Is there a method that also includes joints, since those are supported by USD?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report