Custom Gcode line in Cura 4.0 ?
Posted: Fri May 24, 2019 2:19 am
Hi all,
I've been playing around swapping between Slic3r and Cura.
I have Cura 4.0, I have several flavours of Slic3r available, the most commonly used being Slic3r PE as supplied via Josef Prusa.
I have a question regarding some custom gcode placed at the end of a run...
I quite like this line I use in Slic3r
"...
{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+10, max_print_height)}{endif} ; Move print head up 10mm
..."
Now at the end of a print, Slicer knows the current height of the head on the Z axis and inserts a relevant bit of code here...
Say the print ends at a height of 46.7mm, then when Slic3r produces the gcode for the printer, then using this line it would insert
- G1 Z56.7 ; Move print head up 10mm -
Fantastic, the head moves up 10mm, the next line in my custom gcode for the end of the run moves the bed forwards to allow easy removal of the component...
Every different component with a different ending height automatically gets the correct Z movement code to lift the head by 10mm.
Now this doesn't work in Cura 4.0
Naturally, the variables will be different and Cura doesn't recognise these as numbers it can use.
Question is...
Does anyone out there know a similar line of code that will work in Cura ???
Hopes,
Gerry
I've been playing around swapping between Slic3r and Cura.
I have Cura 4.0, I have several flavours of Slic3r available, the most commonly used being Slic3r PE as supplied via Josef Prusa.
I have a question regarding some custom gcode placed at the end of a run...
I quite like this line I use in Slic3r
"...
{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+10, max_print_height)}{endif} ; Move print head up 10mm
..."
Now at the end of a print, Slicer knows the current height of the head on the Z axis and inserts a relevant bit of code here...
Say the print ends at a height of 46.7mm, then when Slic3r produces the gcode for the printer, then using this line it would insert
- G1 Z56.7 ; Move print head up 10mm -
Fantastic, the head moves up 10mm, the next line in my custom gcode for the end of the run moves the bed forwards to allow easy removal of the component...
Every different component with a different ending height automatically gets the correct Z movement code to lift the head by 10mm.
Now this doesn't work in Cura 4.0
Naturally, the variables will be different and Cura doesn't recognise these as numbers it can use.
Question is...
Does anyone out there know a similar line of code that will work in Cura ???
Hopes,
Gerry