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: 

When you get a public link, you share it

2 REPLIES 2
Reply
Message 1 of 3
kandennti
109 Views, 2 Replies

When you get a public link, you share it

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.

2 REPLIES 2
Message 2 of 3
BrianEkins
in reply to: kandennti

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
Message 3 of 3
kandennti
in reply to: BrianEkins

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.

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