Is there an API for PrusaSlicer?
 
Notifications
Clear all

Is there an API for PrusaSlicer?  

  RSS
YigalB
(@yigalb-2)
Eminent Member
Is there an API for PrusaSlicer?

Is there an API for PrusaSlicer, so I could call PrusaSlicer from activate it, including changing setup, slice, set color change, etc.?

I would like to control the slicer via C# (VisualStudio)

Posted : 07/03/2023 7:07 pm
Neophyl
(@neophyl)
Illustrious Member
RE: Is there an API for PrusaSlicer?

No.  There's the command line option.  That has a limited subset of switches and can call a 3mf project file with settings in it but I dont think it will do what you want realistically.

I suspect you will have to open a feature request on the PS github.  Good luck.  https://github.com/prusa3d/PrusaSlicer/issues

Posted : 07/03/2023 7:51 pm
1 people liked
YigalB
(@yigalb-2)
Eminent Member
Topic starter answered:
RE: Is there an API for PrusaSlicer?

 

Posted by: @neophyl

No.  There's the command line option.  That has a limited subset of switches and can call a 3mf project file with settings in it but I dont think it will do what you want realistically.

I suspect you will have to open a feature request on the PS github.  Good luck.  https://github.com/prusa3d/PrusaSlicer/issues

I opened such a request and got a fast NO: "We are not going to implement such an API any time soon. Contributions are welcome."

Posted : 08/03/2023 5:45 pm
Diem
 Diem
(@diem)
Illustrious Member

Slicer isn't really intended for remote operation so the API route complicates matters.  If you want to control the slicer remotely then either set it up on a machine with a VNC server or similar and control it graphically or, and this is nearest to an API, or write an invocation script (Python, or I would use perl) with it's own API and have that compute a command string and launch slicer from the shell.

Cheerio,

Posted : 08/03/2023 7:53 pm
YigalB
(@yigalb-2)
Eminent Member
Topic starter answered:
RE:

The target of the API is not to remote control.

It is to control the slicer with pre-made scripts.

This will allow to run the design (OpenSCAD in my case) and the slicing automatically, with parameters changing - all  offline.

This post was modified 3 years ago by YigalB
Posted : 09/03/2023 8:21 am
JimB
 JimB
(@jimb)
Estimable Member
RE: Is there an API for PrusaSlicer?

You might be able to do what you want with the prusa-slicer command line options.

prusa-slicer --help
prusa-slicer --help-fff

I was able to give it an stl file, have it load a config file, slice and save the gcode file which seemed to work.

prusa-slicer --load myconfig.ini --slice test.stl

Although I tried to trigger a color change with the --colorprint-heights option, but I could not get it to do anything.  Don't know if it is broken or I am just not using it right.  You might have to post-process the gcode to inset color changes at the desired places.

Posted : 09/03/2023 1:12 pm
1 people liked
Diem
 Diem
(@diem)
Illustrious Member

OK, so it's not an API problem in the usual sense.

You can invoke an OpenSCAD script from shell (eg: bash) or script with parameters passed from the run-time call.  You can pipe the output into PrusaSlicer OR save an intermediate file with a predefined name then the same script can invoke PrusaSlicer with variables also calculated at run-time.

I have done this at proof-of-concept level with the vague intention of making a web interface for a customisable product that would run through to emailing an STL to the user - but I haven't completed the project, thank for the reminder, maybe I should return to it.

Cheerio,

Posted : 09/03/2023 3:47 pm
1 people liked
Azonic3D
(@azonic3d-2)
Eminent Member
RE:

My use case would be to extract completed print data to track cost, inventory levels, uptime, etc. into other programs so that I don't have to manually add this data to a spreadsheet.

How to others here track costing information? Is there another export/connector function I'm not aware of that I can use to achieve this?

Posted : 03/11/2025 2:40 am
_KaszpiR_
(@_kaszpir_)
Noble Member
RE: Is there an API for PrusaSlicer?

In that case PrusaSlicer is not enough, because it produces the input for the printer. You want to track the printer usage via PrusaLink.

See my GitHub and printables.com for some 3d stuff that you may like.

Posted : 03/11/2025 8:22 am
ssmith
(@ssmith)
Estimable Member
RE: Is there an API for PrusaSlicer?

Have you looked at the OpenPrintTag announcement? So far only tagged Prusament and blank tags available, but the intent looks like much of what you're looking for.

Posted : 03/11/2025 6:25 pm
1 people liked
Azonic3D
(@azonic3d-2)
Eminent Member
RE: Is there an API for PrusaSlicer?

I see this setting in Prusa Connect. Seems like where one would start. However, when I open up PrusaLink, I only get realtime telemetry info and what's stored on the USB drive. Am I missing something? Do I need to configure this somewhere else?

Posted : 03/11/2025 8:24 pm
Azonic3D
(@azonic3d-2)
Eminent Member
RE: Is there an API for PrusaSlicer?

Also, any reason my Print History isn't complete? Is it limited to the last 3 months or so? Is there a record somewhere of all prints completed(or stopped/errored out) by the machine?

Posted : 03/11/2025 8:27 pm
ssmith
(@ssmith)
Estimable Member
RE: Is there an API for PrusaSlicer?

 

Posted by: @azonic3d-2

Also, any reason my Print History isn't complete? Is it limited to the last 3 months or so? Is there a record somewhere of all prints completed(or stopped/errored out) by the machine?

Take a look in the Prusa app (not Connect), the print history there seems to be preserved longer on my machines.

Posted : 03/11/2025 8:30 pm
Share: