Confusion about API purpose and implementation

Confusion about API purpose and implementation

Anonymous
792 Views
9 Replies
Message 1 of 10

Confusion about API purpose and implementation

Anonymous
Not applicable

Hi,

 

I am confused as to the how exactly the API lets me interact with Fusion 360. Does the API allow for backend integration, or is it merely something for running scripts on my computer?

 

To elaborate, I have a platform where users perform calculations and build structures component by component. Users can build models in CAD that are parametrically driven by these equations. This means that when the math changes, the designs can be automatically updated in Fusion 360. For this to be effective, I need to be able to do this on the back end where my server sends this data to the proper model in Fusion 360 and the parameter is automatically updated. There seem to be commands for this in the Fusion 360 API, but I cannot tell where those programs are run. Are they simply run on a persons computer where data is read from excel files or other places or can I send data on the back end?

 

Also, I found the autodesk forge php platform and that seems to imply that back end communication is obviously available, but the videos and other things in the documentation is a few years old and the PHP SDK and similar things are discussed.

0 Likes
793 Views
9 Replies
Replies (9)
Message 2 of 10

JesusFreke
Advocate
Advocate

All scripts run in the fusion 360 client, and the API really only deals with modifying models within the context of the locally running client.

 

The scripts are written in either python or c++, so you're not limited to just the fusion api functionality. You can write your own networking logic, etc. So you could write some logic for the fusion 360 instance running on the client that talks to a server and updates the model based on information sent back from the server.

0 Likes
Message 3 of 10

Anonymous
Not applicable

It seems very odd to me that it is not possible to adjust the model stored in the cloud. Does that mean that my platform relies upon the user to initiate a script to communicate with the Fusion 360 model? There is no way for my platform to initiate a change in a parameter on a Fusion 360 model?

0 Likes
Message 4 of 10

JesusFreke
Advocate
Advocate

The script runs within the context of a fusion 360 client, and can access models from any hubs that are available in that instance of fusion 360. e.g. You can open files from the hub, modify them, an save them back to the hub.

0 Likes
Message 5 of 10

Anonymous
Not applicable

If scripts only run within the context of Fusion 360, what are the APIs that relate to displaying data used for? Why would anyone need to display a 3D model if that model has to already be opened in Fusion 360 to run the script on it?

 

Are scripts and API's the same thing? It seems to me that they are being conflated within the documentation. A script should be something that is run within Fusion 360 that performs a task - like in the examples where the number of teeth on a gear are changed. An API should allow a foreign system access to Fusion 360 models - hence the need for an ID and a secret. In this manner, a user could alter something on my system, and it would reflect in the associated Fusion 360 model. 

0 Likes
Message 6 of 10

JesusFreke
Advocate
Advocate

A script is a program that is written in python or c++, and that runs in the context of the fusion 360 client. It's literally running in the fusion 360 process.

 

An API is a programming interface. A script calls an API. The script always runs within the context of the local fusion 360 client, but it can call APIs that access data from the hub. E.g. to open a document from the hub, or save a document to the hub. But it can't directly modify models in the hub. You have to open the document from the hub, modify it locally, and then save it back to the hub.

0 Likes
Message 7 of 10

Anonymous
Not applicable

I still feel like I am missing something.

 

Why do I need to register an app and have an ID and a secret if all the API is doing is running Fusion 360 programs in the hub? What is the purpose of the OAuth, the secret, and the ID if there is no communication with my app?

0 Likes
Message 8 of 10

JesusFreke
Advocate
Advocate

There is no mention of oauth tokens, secrets or api keys in the fusion 360 api documentation as far as I'm aware. Perhaps you are talking about a different api?

 

For reference, here is the fusion 360 api documentation:  https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-A92A4B10-3781-4925-94C6-47DA85A4F65A

0 Likes
Message 9 of 10

Anonymous
Not applicable

OK. So my confusion is that there is likely an AutoCAD platform of some kind that facilitates that level of communication, but not Fusion 360.

0 Likes
Message 10 of 10

Anonymous
Not applicable

Is it possible that I could accomplish this through another manner in Forge?

0 Likes