script on layer change
-
Hello Guys,
I want to have the duet execute a script on every new layer without having to add that in the slicer, similar to the "start.g" or "end.g" files.
Is there any tricks to do that already?
I guess as long as there are some kind of layer indicators in the gcode that could be doable? -
@too you could put M98 P"LayerChange.g" in your slicer layer change settings, and create a LayerChange.g macro to define the behaviour locally.
At least that would mean you could change that behaviour globally without having to re-slice your code.
-
@cncmodeller That's a good tip, I have actually resorted to something similar!
I created a "M2001.g" file in the sys folder and added a M2001 command on each layer change...The issue is that I am using a custom slicer that I can't easily change myself and that doesn't have this capability (that at least adds ";LAYER: ##" markers at the beginning of a new layer). I was hoping to not have to manually change the gcode file, but thank god for the "change all occurrences" function in VSCode