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

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

chris.monachanZWSCF
Enthusiast Enthusiast
492 Views
4 Replies
Message 1 of 5

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

chris.monachanZWSCF
Enthusiast
Enthusiast

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.

0 Likes
Accepted solutions (1)
493 Views
4 Replies
Replies (4)
Message 2 of 5

BrianEkins
Mentor
Mentor
Accepted solution

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
0 Likes
Message 3 of 5

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

chris.monachanZWSCF
Enthusiast
Enthusiast

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.

0 Likes
Message 5 of 5

chris.monachanZWSCF
Enthusiast
Enthusiast
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?
0 Likes