Is it possible to export an assembly via API?

michelmarroche
Contributor
Contributor

Is it possible to export an assembly via API?

michelmarroche
Contributor
Contributor

I am working on a couple of scripts to download and upload projects from cloud to local.

 

I have already managed to download the projects with their structure and upload them again while maintaining their structure.

 

Now I am trying to export the designs that have assemblies, I can only do it manually from Export, and this creates a local ".f3z" file .. but I can't find how to do this from within a script ..

 

Will it be possible?

 

Thank you !

0 Likes
Reply
Accepted solutions (1)
1,027 Views
4 Replies
Replies (4)

kandennti
Mentor
Mentor
Accepted solution

Hi @michelmarroche .

 

I found a way to export in the same way as the GUI.

    app.executeTextCommand(u'data.fileExport f3z')

https://github.com/kantoku-code/Fusion360_Small_Tools_for_Developers/blob/master/TextCommands/TextCo... 

 

It takes a lot of time because it is the same as GUI.

0 Likes

michelmarroche
Contributor
Contributor

Hi @kandennti thank you very much !

 

I will try it!

 

If it takes a while but allows the assemblies to be properly backed up, it will work!

 

 

0 Likes

kandennti
Mentor
Mentor

@michelmarroche .

 

I didn't notice it when I wrote it, but I received a lot of emails ...

0 Likes

ryansmith_
Contributor
Contributor

Thanks for this post @kandennti and your post on Fusion360_Small_Tools_for_Developers/TextCommands/TextCommands_txt_Ver2_0_8176.txt at master · kanto....

 

I'm trying to reliably export f3z files that require cloud translation. The following works in a python script to set the location but doesn't allow for name changes. 

 

            textCommand = f'data.fileExport f3z "{output_folder_path}"'
            app.executeTextCommand(textCommand)
 
I was able to get a new name and location using the neu_server.export in the Text Command window but not in a python script.
 
neu_server.export(r'C:\Users\<username>\OneDrive\Fusion 360 Data\test.f3z')
 
Do you know a way to run this from python?
 
I'm also finding that renaming a Document is not allowed and renaming a dataFile by dataFile.name = newName works for the dataFile but doesn't reliably update the Document.name, which is the name used in exports. Have you found any way to work through this?
 
0 Likes