Echo current layer number
-
in my layer change gcode i would like to output the current layer #
currently im just using echo "layer changed"
but id like to output echo "Layer 1 complete"how do I do the script to add the layer#?
the reason is if it fails I will know what was the last layer completed, in console
-
What slicer do you use? It may be easiest to have the slicer add an M117 command with the slicers layer # variable.
-
@phaedrux PrusaSlicer
-
@adamfilip you can try echoing OM variable job.layer. It will only work if the slicer has put recognised layer number comments in the GCode file. If the layer number comments are not seen then it will be null, so you probably want to test whether it exists first.
-
In PrusaSlicer, go to Printer Settings, and then custom gcode.
Then addM117 [layer_num]
to the After layer change G-code section.