Is it possible to execute a command from the command line that runs a Python file that does modelling on Fusion 360 ?

Is it possible to execute a command from the command line that runs a Python file that does modelling on Fusion 360 ?

jonassog
Contributor Contributor
997 Views
4 Replies
Message 1 of 5

Is it possible to execute a command from the command line that runs a Python file that does modelling on Fusion 360 ?

jonassog
Contributor
Contributor

Hi all,

 

As the title said, I am wondering if it is possible to execute a command from the command line that runs a Python file that does modelling on Fusion 360 ? I have seen another thread that discusses the possibility of this if the Python file doesn't do any modeling. However, I do need to model. Everything works fine if I manually run the Python file from the F360 GUI, but I need to automate this Python file execution.

 

Thanks a lot in advance!

0 Likes
Accepted solutions (1)
998 Views
4 Replies
Replies (4)
Message 2 of 5

Jorge_Jaramillo
Collaborator
Collaborator

Hi,

 

Yes, It has to run inside Fusion 360 if you need to interact with the model.

So what you need is to have an add-in running that could receive the order to execute the code inside Fusion 360.  It could be achieved with a inter-process communication implementation.

 

I hope this could help you out.

 

Best regards,

Jorge Jaramillo

Software Engineer

 

Message 3 of 5

jonassog
Contributor
Contributor

Hi,

 

Thanks for your answer. I was wondering if I can do that without opening Fusion 360? For instance with only a command line in the terminal? Or only from Python?

0 Likes
Message 4 of 5

ltomuta
Advisor
Advisor
Accepted solution

You can't do it from outside Fusion. Inside Fusion you have the option of writing scripts and add-ins in Python or call the interpreter directly through the Text Commands window.

If you really must do it from outside Fusion then you can use something like the FreeCAD API and once your design is generated you can bring that into Fusion.

Message 5 of 5

Jorge_Jaramillo
Collaborator
Collaborator
Hi,
For sure, Fusion 360 has to be running if the script will deal with the model.
Command line or pure python from outside Fusion 360 will need further development.