Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Get DataProject online URL?

thomasa88
Advocate

Get DataProject online URL?

thomasa88
Advocate
Advocate

Hi,

 

How do I get the Hub URL for a DataProject, to view the project online? Is it called Autodesk 360? Fusion Team?

 

The URL looks like this when having clicked the "Open on the Web" button in Fusion 360:

 

https://<my email domain + numbers>.autodesk360.com/g/projects/20220710538787581/data/<base 64 string>

 

 

I guess the base64 string might be the ID of the project, but how to get the subdomain of the URL?

 

I have found DataFile.publicLink, but that is to a specific file and it also makes the file public(?).

 

 

 

 

0 Likes
Reply
543 Views
6 Replies
Replies (6)

kandennti
Mentor
Mentor

Hi @thomasa88 .

 

We have not been able to find out everything, but we will describe as much as we know.

 

This will be in the active document.
The following text command will open the metadata file.

data.metadata

The part that becomes <my email domain + numbers> seems to correspond to the "hubUrl" in the metadata.
The part "20220710538787581" seems to correspond to "ProjectId".
As for the <base 64 string> part, I could not find it at all.

 

The folder containing the metadata files can be obtained with the following command

Cache.path

But I don't know how to get the metadata file name from the active document. I may be able to guess, but I am a little worried.

 

Also, I was able to get a list of metadata files in the cache folder with this command.

Cache.contents

 

This command may also be useful.

data.property

 

0 Likes

thomasa88
Advocate
Advocate

Thanks! A little bit closer.

 

data.property seems good for getting the Hub ID/URL.

 

 

The base64 part in my case is:

 

 

dXJuOmFkc2sud2lwcHJvZDpmcy5mb2xkZXI6Y28ucWdDTEl1UTFSWUN2ME9oQnlKNWd5QQ==

 

 

It translates to:

 

 

urn:adsk.wipprod:fs.folder:co.qgCLIuQ1RYCv0OhByJ5gyA

 

 

 

It is the ID of the folder:

 

 

Python> app.activeDocument.dataFile.parentFolder.id
urn:adsk.wipprod:fs.folder:co.qgCLIuQ1RYCv0OhByJ5gyA

 

 

 

 

I thought that maybe the Fusion Forge API might give the hub URL, but it seems that it does not.

https://aps.autodesk.com/en/docs/data/v2/reference/http/hubs-hub_id-GET/ (The response at the bottom of the page)

 

 

EDIT. Ok, this might be a full but ugly flow:

 

Python> app.activeDocument.dataFile.id 
file_id=urn:adsk.wipprod:dm.lineage:MGXJxer7QiSD0S6cF8CVjg

Text> Cache.path
full_cache_path

# Loop through the "._xx" files in Cache.path, looking for file_id in <LineageUri>
# Grab <hubUrl> and <ProjectId>

Python> app.activeDocument.dataFile.parentFolder.id 
folder_id=urn:adsk.wipprod:fs.folder:co.qgCLIuQ1RYCv0OhByJ5gyA

# Build URL: <hubUrl>/g/projects/<ProjectId>/data/<base64(folder_id)>

 

1 Like

kandennti
Mentor
Mentor
1 Like

thomasa88
Advocate
Advocate

Thanks! It's nice to see that you are still active on the forums and digging deep into Fusion! 🙂

 

Have you found a way to force a file into the cache, without opening it? Right now, the method fails on some files for me, since they are not in the cache.

DataFile.refresh() does not help.

0 Likes

kandennti
Mentor
Mentor

@thomasa88 .

 

I don't know how to put the file in the cache without opening it.

I suppose it would be nice if I could get just the metadata from the datafile object, but I don't know how to do that either.

0 Likes

thomasa88
Advocate
Advocate

Looking closer at the project ID, it seems to be (partially?) date based.

 

Here are the IDs of two projects created maybe 30-60 seconds after each other, at around 2022-12-17 12:48 UTC

 

20221217589885881
20221217589885906
YYYYMMDD

 

0 Likes