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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error with Add-In only on startup

Message 1 of 2
170 Views, 1 Reply

Error with Add-In only on startup

I've been working on a custom API for incremental part numbering, and it works great if I run it manually. However, on startup I get an error that I haven't been able to figure out the meaning of. I've included the error that displays in the text window below:

Traceback (most recent call last):
  File "C:/Users/rmcla/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/AddIns/Seabound_Part/", line 9, in run
  File "C:\Users/rmcla/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/AddIns/Seabound_Part\commands\", line 24, in start
  File "C:\Users/rmcla/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/AddIns/Seabound_Part\commands\incremental_part\", line 75, in start
    new_subsystem_dict = futil.refresh_part_numbers()    # custom function in
  File "C:\Users/rmcla/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/AddIns/Seabound_Part\lib\fusion360utils\", line 208, in refresh_part_numbers
    raw_parts_dict__ = get_existing_parts()	# another custom function, used by refresh_part_numbers()
  File "C:\Users/rmcla/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/AddIns/Seabound_Part\lib\fusion360utils\", line 137, in get_existing_parts
    files_to_unpack = this_project_.rootFolder.dataFiles.asArray()      # get files in the root folder
  File "C:\Users/rmcla/AppData/Local/Autodesk/webdeploy/production/414da7cdec4faa7986fe0d205fb521fc68f5d46c/Api/Python/packages\adsk\", line 8105, in asArray
    return _core.DataFiles_asArray(self)
RuntimeError: 2 : InternalValidationError : status.isOk() && files

For context, I've also included a snippet from where the error is originating.

    active_hub_ =
    log(f'Active hub: {}')

    all_projects = active_hub_.dataProjects.asArray()       # capture all projects in list of DataProject objects

    for this_project_ in all_projects:
        files_to_unpack = this_project_.rootFolder.dataFiles.asArray()      # get files in the root folder as a list

I reference the active hub and all data projects associated with it, and then loop through each project to check for files . My only idea is that the connection to the data hub needs some time to process, but I don't understand enough about how that connection is established to theorize further.


Like I said, this issue is only on startup. If I stop and re-run the Add-In from the Scripts and Add-Ins menu, there are no issues.


Any help would be appreciated! Thanks!


Message 2 of 2
in reply to: ryanXKM28

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