Cura "Pause at height" retracting filament before resuming

I’m working on a print that I want to swap out the filament at a particular layer. I managed to get the Pause at height plug-in to correctly pause at the layer I want it to, allowing me to use Octoprint to retract the filament, load up the new filament, and extrude a bunch of it to purge the old stuff. The problem is, when I resume, the extruder lines up with the print then retracts a bunch of filament (last time it did so much the filament came completely out of the head) then tries to print with no filament.

Looking at the gcode that was added by the plugin, I see that right before it resumes it sets the extruder back to absolute positioning and with a G92 sets the extruder position to where it last was. I’m guessing that when I’m extruding the new filament with Octoprint, it’s seeing that as the extruder moving forward, then it hits the G92 and thinks it has to retract to get to that position again. There is some gcode added right before the pause that sets the extruder to relative mode and even an M84 to disable the extruder, so I would have thought that was meant to tell the printer to just ignore any extruder movements - but clearly something’s not working as intended.

Any help would be greatly appreciated, since the only suggestion I’ve found online is to switch to relative positioning in Special Modes and I don’t see that in the Lulzbot edition of Cura.

Edit: Tested with both Lulzbot Cura 2.6 and 3.2 with same results

Edit 2: Just found the Relative Extrusion setting - it was turned off by default in the Settings Visibility preferences. Will try that shortly and report back

gcode added by the Pause at height plug-in:

M83 ;switch to relative positioning
G1 Z1.805000 F300 ;pull the print head up
G1 X190.000000 Y190.000000 F9000 ;move the print head away from print
G1 Z15 F300 ;pull the print head up even more
M84 E0 ;turn off the extruder
M104 S0; standby temperature
M0 ;Do the actual pause
M109 S0; resume temperature
G1 Z1.805000 F300 ;move the print head down
G1 X181.250000 Y151.250000 F9000 ;move the print head back over the print
G1 F9000 ;i honestly have no idea?
M82 ;switch back to absoluate positioning
G92 E150.600440 ;set the extruder to this position and ruin everything!

I have re-written part of the post-processing script PauseAtHeight.py and named it PauseAtHeightorLayer.py which I have attached. In addition to adding the option to pause at a layer number or a height, I have fixed some bugs in the original such as relative/absolute extrusion detection. The code also contains relative/absolute xyz but it is untested as none of my slicers can output gcode with relative xyz.

For a default install of CuraLE 3.2, place the file in C:\Program Files (x86)\cura-lulzbot 3.2\plugins\PostProcessingPlugin\scripts

I have submitted the file to LulzBot and I believe they will include it in some future version of CuraLE, but here it is now.
PauseAtHeightorLayer.zip (3.16 KB)

I have a Taz 6 with a recently installed Dual Print head (v3). I have some models that I don’t know how to split into pieces to print using both printheads. Can I use my new printhead to “Pause at Height” and swap out filaments? If so, how do I do that (both swap out filament and tell it where to pause). I know how to physically swap filament that is not the issue.

Thanks for any advice.

The “PauseAtHeightOrLayer” post-processing script can be used to pause a print and allow for filament swapping.It is intended to be used with a single extruder. With a Dual Extruder V3, instead of physically swapping the filament the script should just change the extruder. I’ll have to think about this a bit before I attempt to write such a script. If I get it working, I’ll post it here.

Thanks, not what I intended, but now that you mention it.