Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

"Open" & "Save" Silently Using A Fusion 360 Python Script

isocam
Collaborator Collaborator
763 Views
4 Replies
Message 1 of 5

"Open" & "Save" Silently Using A Fusion 360 Python Script

isocam
Collaborator
Collaborator

Can anybody help???

 

Using a Fusion 360 API script, is it possible to "Save" or "Open" a document silently?

 

"Save"

I want to be able to save a "Assembly", "Part", or "Drawing" silently.

 

"Open"

I want to be able to "Open" a Fusion 360 "Part" and get its attributes.

 

Many thanks in advance!

 

Darren

Reply
Reply
0 Likes
764 Views
4 Replies
Replies (4)
Message 2 of 5

kandennti
Mentor
Mentor

Hi @isocam .

 

Saving is done by the save or saveAs method of the Document Object.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-54a08742-92b2-4831-b9e6-4161b89f6e1e 

 

Open is the open method of Documents Object.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-29580a5e-995a-489e-9ea0-9753c1e11ac0 

 

The Application Object has documentOpened and documentSaved events for documents, but the events are not fired when the document itself is saved or opened, but when the command itself is completed.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-7209c4c7-bc58-4388-9e20-036410459094 

 

This makes it very difficult to know when to get the attributes after the document is opened.

 

 

Here is an example of monitoring the timing of f2d opening using a text command.

https://forums.autodesk.com/t5/fusion-360-api-and-scripts/drawing-pdf-export-how-to-access-the-new-e... 

 

Please respond occasionally.

 

Reply
Reply
0 Likes
Message 3 of 5

BrianEkins
Mentor
Mentor

I think you need to define what you mean by "silently".

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Reply
Reply
0 Likes
Message 4 of 5

isocam
Collaborator
Collaborator

By "Silently" I mean that you do not physically see anything happening. It is all done in the background.

Reply
Reply
0 Likes
Message 5 of 5

BrianEkins
Mentor
Mentor

Many of us are used to using a program to start an application or connect to an instance that's already running and then interacting with the application using it's API. And doing this all invisibly. This type of functionality is natively supported by an application that uses COM (Microsoft's Component Object Model). Fusion does NOT use COM and doesn't support access to the API from an external process, so what you described is not currently possible.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Reply
Reply
0 Likes