r/pythonhelp • u/hero_verma • Feb 15 '25
Unable to run Aysnc plugin/add-ins in fusion 360. IPC
I am making a plugin/Add-in for Fusion360. However, the plugin code uses the Async library from Python which conflicts with the core working of Fusion360(Mostly run Single Threaded).
This rases many errors which of course I'm unable to find solutions too (I'm still new to coding, I belong to other working field).
So, if you have any suggestions to it, please help me.
One of the thing I can think of is running a seporate application for generating data and have my plugin get data from there, like create Inter Process Communication. But, in the first place I don't know if it is possible or not.
Like I want to run the async code in different application and then pipe its data to plugin, so I wonder if there will be more errors that the fusion360 might raise.
Also are there any other way to approach this problem.
•
u/AutoModerator Feb 15 '25
To give us the best chance to help you, please include any relevant code.
Note. Please do not submit images of your code. Instead, for shorter code you can use Reddit markdown (4 spaces or backticks, see this Formatting Guide). If you have formatting issues or want to post longer sections of code, please use Privatebin, GitHub or Compiler Explorer.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/trd1073 Feb 15 '25
Going to need more details. I have never dealt with Fusion360.
Who is making you use the async code? Going to assume you found some example code in async and assumed that is way to do it. Could you rewrite the example code to sync paradigm?
Will have to see some more info on questions before go further. Inter process/program can be done many ways, don't want to over complicate things too fast if can be resolved with simpler methods.
1
u/trd1073 Feb 15 '25
If that is the case, then couple of options.
If you want a single program, you can use multiprocessing to have one process to get data from ble and the other to do the sync work. They can communicate with multiprocessing queues. Async puts data to the queue and sync would get data. Or use zeromq. Ggl how to make them talk before you commit to a way. This site helped me alot for multiprocessing https://superfastpython.com/
Or you can do two separate programs. One to acquire the async data and second to do the sync work. Zeromq is one straightforward way to do comms that doesn't require a server, such as rabbitmq or redid pub/sub would. Might also look at pipes and sockets.