Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

findFileByFileID() fails unless Fusion has already 'seen' the file

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
chris.monachanZWSCF
183 Views, 4 Replies

findFileByFileID() fails unless Fusion has already 'seen' the file

I'm finding that the first time I call findFileByFileID() with a valid URN it fails. If I then iterate through all the files in code or just in the UI Dataview browse to where the file is, the call then doesn't fail.  Snippet of C++:

 

auto ptrFile = ptrApplication->data()->findFileById( oFileURNAttribute->value() );

 

The ID I'm using is in the form : 'urn:adsk.wipprod:dm.lineage:A09KFuSFRWevaFnZKMhA1Q'

 

Is this expected behaviour? The documentation doesn't say anything about it needing the file to be already discovered before the findFileById() method works. It is very reproducible.

4 REPLIES 4
Message 2 of 5

There's a similar problem that has been fixed in the next release, which should be out later this month.  You should try testing this again when it comes out.  If it's still a problem, please report it here.

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

Excellent. There are always a good number of bugs fixed with each release. Looking forward to it. Thanks.
Message 4 of 5

Just FYI. This still seems to be broken in the latest release. The work-a-round is to browse the files in the DataManager first before trying to open one.

Message 5 of 5

Hi Brian,

Just to say that as well as this not being fixed, I think there has been a regression in the file system. Now my drawing templates aren't found, unless I browse to the area in the cloud file system where they are stored first. Otherwise it just reports an error.

Shall I put this as a separate post on the forum or is it already a bug you're tracking?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report