Listing project's folders/files using local/cached data

Listing project's folders/files using local/cached data

ltomuta
Advisor Advisor
472 Views
2 Replies
Message 1 of 3

Listing project's folders/files using local/cached data

ltomuta
Advisor
Advisor

I'm drafting a quick script but the performance is extremely poor as attempting to list project's file structure leads to countless server side API calls.

 

Is there a way to
a) get the entire  file structure in one call (folders and/or files)?

b) tell the API that the local cache will suffice (without putting Fusion on offline mode, even if that would work) ? 

0 Likes
Accepted solutions (1)
473 Views
2 Replies
Replies (2)
Message 2 of 3

kandennti
Mentor
Mentor
Accepted solution

Hi @ltomuta .

 

DataHubs, DataFolders, and DataFiles can now be accessed faster than before by using the asArray method.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-1BB4CB50-4CBA-4FD6-9250-C2CC501B9058 

 

This is a good reference.

https://forums.autodesk.com/t5/fusion-360-api-and-scripts/access-file-tree-structure/m-p/10373517 

 

 

If you really need the local cache data, you can get the path to the folder with the following text command

Cache.path

 

I also used the path of the local cache folder with this add-in.

https://github.com/kantoku-code/Fusion360_Rescue_F3D/blob/main/Rescue_F3D/Rescue_F3D_core.py#L95 

Message 3 of 3

ltomuta
Advisor
Advisor
Excellent. This is exactly what I was looking for. Thank you!
0 Likes