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: 

Pass JSON in protocol handler

Message 1 of 5
282 Views, 4 Replies

Pass JSON in protocol handler

Basically, I want to do the following:

  1. Pass IDs for projects, folders, and files in the properties of the protocol handler
  2. Pass some data in the same place
  3. Parse that JSON in the Fusion App and then open those files and apply that data

My issue is that the JSON decoder keeps giving me an error and I can't figure out why. Any recommendations for passing JSON in the protocol handler?

Message 2 of 5
in reply to: joshuafoxworth

What error are you seeing? And what is the json input that is generating the error?

Message 3 of 5
in reply to: JesusFreke

I load the json library and then attempt to use the json.loads command. It just gives me an exception that there was an issue parsing that data.


I have tried a few ways to pass the JSON data, but I believe that the problem is that I replace the double quotes used for the JSON object with single quotes so that I could pass the data in the protocol handler without issues.

Message 4 of 5
in reply to: joshuafoxworth

If you want us to help you, to have to give us enough details to be able to help you :).


When you are trying to get help with a specific error, you should include the exact error message you are receiving. And when it's something like this, it's best to include the input that is causing the error as well.

Message 5 of 5
in reply to: JesusFreke

OK. So I am working in the Spyder IDE. I have a print command to output a part of the dict that is created when the JSON was parsed. However, that print would never happen so I assumed that there was an error. Whenever I would hit enter in the console, there was an error there as well.


What I eventually discovered is that the print just doesn't happen, but I can make it happen when I hit enter in the console. Not sure why this is.

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