Hi @isocam -San.
We have created a simple sample script.
For a simple sample, we are not looking for deep folders.
Also, Fusion360's data panel allows files with the same name to be created in the same folder. Therefore, there is a possibility that the desired file cannot be opened.
# Fusion360API Python script
import traceback
import adsk.core as core
def run(context):
ui: core.UserInterface = None
try:
app: core.Application = core.Application.get()
ui = app.userInterface
projectName = "PROJECT FILES"
folderName = "TEST FOLDER"
fileName = "TEST PART"
# Project
proj: core.DataProject = None
for x in app.data.dataProjects.asArray():
if x.name == projectName:
proj = x
break
if not proj:
ui.messageBox('No Project')
return
# Folder
folder: core.DataFolder = None
for x in proj.rootFolder.dataFolders.asArray():
if x.name == folderName:
folder = x
break
if not folder:
ui.messageBox('No Folder')
return
# File
file: core.DataFile = None
for x in folder.dataFiles.asArray():
if x.name == fileName:
file = x
break
if not file:
ui.messageBox('No File')
return
# Open
app.documents.open(file, True)
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
I have uploaded here the add-in you asked about in your private message.
https://github.com/kantoku-code/Fusion360_OpenDocumentType-Sample