diff --git a/macros/macros.cfg b/macros/macros.cfg index 3a6f971..7fa9360 100644 --- a/macros/macros.cfg +++ b/macros/macros.cfg @@ -6,13 +6,18 @@ variable_pre_purge_prime_length: 1.4 gcode: SET_GCODE_VARIABLE MACRO=_globals VARIABLE=pre_purge_prime_length VALUE={ variable_pre_purge_prime_length } -[gcode_macro PURGE_LINE] -# https://github.com/JoeCat1207/V0.1-Purge-line-SuperSlicer/blob/main/Purgeline.txt +[gcode_macro CHECK_PRE_PURGE_PRIME_LENGTH] gcode: {% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length %} {% if not PRE_PURGE_PRIME_LENGTH %} {action_raise_error('Pre purge prime length not found')} {% endif %} + +[gcode_macro PURGE_LINE] +# https://github.com/JoeCat1207/V0.1-Purge-line-SuperSlicer/blob/main/Purgeline.txt +gcode: + {% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length %} + CHECK_PRE_PURGE_PRIME_LENGTH G0 Y0 X40 F4000 ; go to tongue of print bed G1 Z0.2 F500.0 ; move bed to nozzle G92 E0.0 ; reset extruder @@ -23,15 +28,6 @@ gcode: G92 E0.0 ; reset extruder G1 Z2.0 ; move nozzle to prevent scratch -# DELETEME -# [gcode_macro CANCEL_PRINT] -# description: Cancel the actual running print -# rename_existing: CANCEL_PRINT_BASE -# gcode: -# TURN_OFF_HEATERS -# M107 ; turn off fan -# CANCEL_PRINT_BASE - [gcode_macro CANCEL_PRINT] rename_existing: BASE_CANCEL_PRINT gcode: @@ -67,10 +63,7 @@ gcode: [gcode_macro PRINT_END] # Use PRINT_END for the slicer ending script - please customize for your slicer of choice gcode: - {% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length %} - {% if not PRE_PURGE_PRIME_LENGTH %} - {action_raise_error('Pre purge prime length not found')} - {% endif %} + {% set PRE_PURGE_PRIME_LENGTH=printer["gcode_macro _globals"].pre_purge_prime_length|default(1.40)|float %} M400 ; wait for buffer to clear G92 E0 ; zero the extruder G1 E-{PRE_PURGE_PRIME_LENGTH} F400 ; retract filament