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

Run script from external python script, automated

2 REPLIES 2
Reply
Message 1 of 3
a.wendler
406 Views, 2 Replies

Run script from external python script, automated

I am working with separate programs and programming languages which produce date for 3D-modelling. Now I need to send that data (e.g. coordinates) from the external programs to a fusion 360 python script or addin which deals with the data and e.g. creates or modifies my already loaded model.

Is there a way to let external software communicate with the scrips and addins or at least trigger them to start without me manually doing so. Ideally I could thus ‘control’ Fusion 360 from the external program. 

Labels (1)
  • API
2 REPLIES 2
Message 2 of 3
JesusFreke
in reply to: a.wendler

You can use any of the normal IPC mechanisms. E.g. you could have a fusion script that listens on a tcp port on localhost, and have your external script connect to that port and send data.

 

Here's an example from an add-in of mine that listens for http and ssdp requests:

 

https://github.com/JesusFreke/fusion_idea_addin/blob/master/fusion_idea_addin.py#L164

Message 3 of 3
a.wendler
in reply to: a.wendler

Thanks for the reply.

I would like to get the connection running without having to rely on network communication.

I managed to get a named pipe connection running between c# and python. However only if the python script doesn't run within Fusion360. As soon as I want the python script to run within Fusion360 the libraries 

win32pipe and win32file "couldn't be found". I guess that is due to the fact that Fusion comes with its own python. Is there a way to get third party library running so that Fusion recognises them?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums