Here's a smaller, simpler script that demonstrates the process. It's essentially the same as in the UI; you need to find the specific file on A360 by going to the project, and any subfolders, and then insert it into the active design. The active design must have been saved at some point or the insert will fail, just like in the UI. In this example, it's placing the file named "Bookshelf" that exists at the top level of the active project.
import adsk.core, adsk.fusion, traceback
_app = adsk.core.Application.cast(None)
_ui = adsk.core.UserInterface.cast(None)
def run(context):
try:
global _app, _ui
_app = adsk.core.Application.get()
_ui = _app.userInterface
project = _app.data.activeProject
bookshelfFile = None
for file in project.rootFolder.dataFiles:
if file.name == 'Bookshelf':
bookshelfFile = file
break
des = adsk.fusion.Design.cast(_app.activeProduct)
root = des.rootComponent
occ = root.occurrences.addByInsert(bookshelfFile, adsk.core.Matrix3D.create(), True)
except:
if _ui:
_ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))