Is it possible to download all the API samples at once?

Is it possible to download all the API samples at once?

tiktuk
Advocate Advocate
856 Views
7 Replies
Message 1 of 8

Is it possible to download all the API samples at once?

tiktuk
Advocate
Advocate

Hi,

 

as the title says, is it possible to download all the API samples at once?

 

I mean those from https://help.autodesk.com/view/fusion360/ENU/?guid=SampleList .

 

Copying them into files individually is possible but takes way more time.

 

Thanks!

0 Likes
857 Views
7 Replies
Replies (7)
Message 2 of 8

BrianEkins
Mentor
Mentor

It's not currently possible to do that, although that is an interesting idea I haven't heard of before. Several ideas have been suggested in the past, but either didn't provide much improvement or would have been too much effort to implement and/or maintain.

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

tiktuk
Advocate
Advocate

An easy solution would be to put them all in a repo at https://github.com/orgs/AutodeskFusion360/ ..

 

It would be really useful to have them all downloaded, so one could quickly search through them.

Message 4 of 8

BrianEkins
Mentor
Mentor

It seems nothing is as simple as it first seems. The samples exist within the Fusion source code and are run automatically as part of a Fusion build to verify that the API hasn't been broken. To be able to function as a test, there is additional code in the sample that's stripped out when the help system uses it. The public versions of the samples only exist in the help.

 

It would probably be easier to package them all in a zip, as you first suggested. Or possibly create a new script that would be downloadable that will contain all the samples, where each sample would be a function within the script. I'm not sure which would be the most usable. Just thinking out loud.

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

tiktuk
Advocate
Advocate

Ok, that's really cool, actually 🙂 .

 

Then an additional step in the build system where the public versions of the samples are zipped and moved to the right location on the server might be a good solution. This zip-file could then be linked to from within the help files.

 

Of course it's some work (once) for the developers but it would be very helpful for us users, I'd say 🙂 .

 

0 Likes
Message 6 of 8

JeromeBriot
Mentor
Mentor

I wrote a Python script that automatically extract all the API samples from the online documentation.

I hope I can publish the zip file on a GitHub repo this weekend.

Stay tuned!

 

fusiuon360-api-samples-00.PNG

 

fusiuon360-api-samples-01.PNG

 

Message 7 of 8

tiktuk
Advocate
Advocate

Wow, amazing @JeromeBriot, thank you so much! I'm sure many other users will be helped by your work as well 🙂 .

 

(Btw. for anyone else interested in offline docs, here are the api docs for download. And they can be read with Read CHM on Mac.)

0 Likes
Message 8 of 8

JeromeBriot
Mentor
Mentor