Sorry, we don't support your browser.  Install a modern browser
This post is closed.

Add gcode macro for 'max_layer_z': the height of a printed object (for better autoprint ejection)#403

I

Hi there!

When using the autoprint with print head push-off, the printhead is currently moved to z = 1.5 mm, regardsless of the printed object. I have noticed some failed pushoffs because of this low z height. Having a higher z height enables a significantly higher torque on the part when autoejecting, making ejections safer and more reliable.
Taking inspiration from Factorian Design (

8:17)

It would be very useful to be able to set the z height as follows:

{if (max_layer_z ) > 41}
G1 Z{max_layer_z - 10} F600
{else}
G1 Z1 F600
{endif}

However, there is currently no max_layer_z macro. Adding this would be lovely.

Thanks.

18 days ago

We just pushed an update that enables “print context variables” for the AutoPrint Gcode Macro: that means these variables will hold information about the print that it’s clearing, so you can use {print_area_max_z} as the max Z height of the print. You can also use {print_current_layer} to just do it by the layer number.

We have also implemented if-statements and while-loops!

So, to achieve what you’re looking for here, you can now do;

{#if {print_area_max_z} > 41}
G1 Z{print_area_max_z - 10} F600
{/if}
{#if {print_area_max_z} <= 41}
G1 Z1 F600
{/if}

(no else statements yet, unfortunately!)

Live as of ~20 minutes ago. Considered beta and experimental, so let us know how you like it, and let us know how it works for you :)

2 days ago
Changed the status to
Completed
2 days ago