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

Can i get the data from the library by API?

chbulee
Explorer

Can i get the data from the library by API?

chbulee
Explorer
Explorer

 

Can i get the data from a different project than the one the user is currently using by API. (something like setting up a library with components and metadata that I than want to share with others) 

0 Likes
Reply
Accepted solutions (1)
433 Views
2 Replies
Replies (2)

marshaltu
Autodesk
Autodesk
Accepted solution

Hello,

 

You would be able to use "Application.Data.DataProjects" to get a list of projects current user can access and use "DataProject.rootFolder" to walk through all data in project. 

 

For example:

import adsk.core, adsk.fusion, traceback

app = adsk.core.Application.cast(None)

def run(context):
    ui = None
    try:
        global app
        app = adsk.core.Application.get()
        ui = app.userInterface
        
        for project in app.data.dataProjects:
            ui.messageBox('Project: {}'.format(project.name))
    
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc())) 

Thanks,

Marshal



Marshal Tu
Fusion Developer
>
0 Likes

chbulee
Explorer
Explorer

Many Thanks,

Marshal

0 Likes