Welcome! Log In Create A New Profile

Advanced

Slic3r - placeholder for total number of layers

Posted by peopoly 
Slic3r - placeholder for total number of layers
April 27, 2017 07:35AM
Hi again,

Thanks for forum's help with the code. We love using Slic3r for SLA printing. We are looking for a way to tag the total number of layers in the gcode. We couldn't find a placeholder for that or a proxy that we can use to calculate.
We were able to use [layer_num] to find current layer number.

Anything help is greatly appreciated.
Re: Slic3r - placeholder for total number of layers
May 04, 2017 09:10AM
On the 'Printer Settings' menu, under 'Custom G-code' you can have Slic3r insert a gcode either before, or after, or both, a layer change. I have Slic3r insert M117 'Before layer change', then have Slic3r run a python script (post processing) and count the number of 'M117' and then rewrite the gcode file with 'M117 Layer x of nn'. The M117 will display the layer message on a screen attached to the printer and/or on an Octoprint screen (I use Octoprint on Raspberry Pi's).
Re: Slic3r - placeholder for total number of layers
May 04, 2017 04:24PM
Could you share the Python script?
Re: Slic3r - placeholder for total number of layers
May 05, 2017 12:25PM
Sure, I translated it from a perl script I found on the internet (trying to keep all my scripts in one flavor). On the 'Output settings' tab, insert your directory location and full script name in the 'Post-processing scripts' box. Slic3r will run the script after it outputs the g-code.
Attachments:
open | download - M117.py (1.7 KB)
Re: Slic3r - placeholder for total number of layers
May 05, 2017 07:03PM
Thanks.
Re: Slic3r - placeholder for total number of layers
May 05, 2017 07:32PM
thanks for your help. will try that
Sorry, only registered users may post in this forum.

Click here to login