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: 

Export dialog path

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
510 Views, 2 Replies

Export dialog path

Hiya all!

 

I'm new to the Fusion 360 api, but I was hoping to change some of the default properties on the Export dialog (specifically the "Save to my computer..." path).

 

It seems like I should be able to catch the export command somewhere, and then modify the command inputs, but I haven't worked out a way to do that (I tried adding my own CommandStarting handler, but couldn't find a way to get/modify inputs in there).

 

Any suggestions would be helpful!

(Fallback is to create my own export dialog, but I'd rather not...)

 

Cheers,

Geoff

Tags (1)
2 REPLIES 2
Message 2 of 3
marshaltu
in reply to: Anonymous

Hello,

 

Unfortunately there is no API to support to customize the export dialog. Instead you can create export dialog by yourself and make use of ExportManager to do export. 

 

For example: the following codes show how to show save file dialog and export file as f3d. 

 

import adsk.core, adsk.fusion, traceback
 
def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui = app.userInterface
        
        filedlg = ui.createFileDialog()
        filedlg.initialDirectory = '/Users/tum/Downloads/'
        filedlg.filter = '*.f3d'
        if filedlg.showSave() == adsk.core.DialogResults.DialogOK:
            design = adsk.fusion.Design.cast(app.activeProduct) 
            option = design.exportManager.createFusionArchiveExportOptions(filedlg.filename, design.rootComponent)
            design.exportManager.execute(option)
 
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

 

Thanks,

Marshal



Marshal Tu
Fusion 360 Developer
Autodesk, Inc.

Message 3 of 3
Anonymous
in reply to: marshaltu

Ah, well that makes sense, thank you!

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