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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Importing external models without saving?

Message 1 of 3
269 Views, 2 Replies

Importing external models without saving?

I have an Add-in I've developed that builds a fairly complex item from specifications that I read from a spreadsheet. I have got to the point where I need to add in various fixings and so forth which I have STEP files for. (Note, the fact they're STEP doesn't matter, I can convert them to anything)


Is there a way for me to bring this into the model I'm building using the API without the user having to first save the document? I know when I try to bring in other components I need to force the user to first save the document, but I was wondering if there is another way I can bring in external elements through the API without forcing the user to save first? 


It wouldn't be so bad if the standard Fusion UI save dialog was available to use, but I believe it's private, and I've tried using TextCommands to bring it up. It works but not very well, and it isn't officially supported.


Any help would be appreciated, even workflow suggestions.

Labels (5)
Message 2 of 3

Hi @chris.monachanZWSCF .


ImportManager can be used to import STEP files without saving them. 


The following sample creates a new document and imports a Step file.

# Fusion360API Python script

import traceback
import adsk.fusion
import adsk.core

def run(context):
    ui: adsk.core.UserInterface = adsk.core.UserInterface.cast(None)
        stpFileName = r'C:\temp\sample.step'

        app: adsk.core.Application = adsk.core.Application.get()
        ui = app.userInterface
        des: adsk.fusion.Design = app.activeProduct
        root: adsk.fusion.Component = des.rootComponent

        importManager: adsk.core.ImportManager = app.importManager
        stpOptions: adsk.core.STEPImportOptions = importManager.createSTEPImportOptions(stpFileName)
        importManager.importToTarget(stpOptions, root)

        if ui:


For more formats, there is a sample here. 


Message 3 of 3

Hey Thanks! That should work for me for now. Although I tried it with a STEP file and it failed. The file imported fine using the UI. But the IGES importer seems to work so I can use that. It could be my STEP file format, although it's odd it imported using the UI.

What would be amazing was if there was a way to load a file from the Cloud Storage. I noticed it can take a URL but it doesn't seem to like the URN type ID's files get from the DataManager. The work-a-round I have is that I'll find the file in the DataManager, export it to a temporary file on disk then use the import manager to import it into the model I'm building. It's a bit clunky but it means I can keep all the data in the cloud.

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