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

When you get a public link, you share it

kandennti
Mentor

When you get a public link, you share it

kandennti
Mentor
Mentor

Hi there.

 

Using the dataFile.publicLink property, a data file that has not been shared will switch to a shared state.

# Fusion360API Python script

import traceback
import adsk.fusion
import adsk.core

def run(context):
    ui = adsk.core.UserInterface.cast(None)
    try:
        app: adsk.core.Application = adsk.core.Application.get()
        ui = app.userInterface

        datas = app.data.activeFolder.dataFiles.asArray()
        data: adsk.core.DataFile = datas[0]

        app.log(f'ver {app.version}')
        app.log(f'{data.name}.{data.fileExtension}')
        app.log(data.publicLink)

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

 

1.png

 

This feels like an undesirable state.

0 Likes
Reply
202 Views
2 Replies
Replies (2)

BrianEkins
Mentor
Mentor

Why is this an undesirable state? It seems like that is essentially the same behavior as you see in the UI. The thing the API is missing is the switch to turn off sharing.

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

kandennti
Mentor
Mentor

Thanks for the reply @BrianEkins .

 

I was expecting the value of the dataFile.publicLink property to be an empty string if sharing is turned off.

I don't mind that the dataFile.publicLink property is not an empty string, but I don't want sharing to be turned on by itself.

 

For this matter, I have confirmed that sharing is also turned on by itself when operated with a web browser. (All in Japanese).

https://forums.autodesk.com/t5/fusion-360-ri-ben-yu/gong-yourinkugaonnisareteshimau/td-p/11248968 

 

I have a feeling that this is not just an API problem.

1 Like