<p>Don’t home the Z. Rather measure the height of your print to continue at with calipers. Or with detective work in your G-code preview, finding the layer your print stopped at and finding the Z height of that layer. The direction of the infill can be a clue. Then carefully lower your Z-axis until your nozzle is at the right height for your next layer (so get the nozzle .2 mm above your printed layer if you’re doing .2 mm layers).</p>
<p>Edit your print G-code to change <code>G28</code>, to be <code>G28 X0 Y0</code>, so that it only homes X and Y, not Z. Erase any line with <code>G29</code> (auto-leveling routine), or it will crash into your print. After the <code>G28 X0 Y0</code> line, enter <code>G92 Z</code>[your starting Z layer height in mm] that spoofs the Z position to the 3D printer, and it shouldn’t need to home. Then edit the rest of the G-code to start at the next layer of your resumed print.</p>
<p>Leave all the beginning commands that do setup, temperature, and erase the lines beginning with the movement, lots of <code>G1</code> commands. Find the <code>G1 Z</code>[your resumed layer height] command and begin there, that’s the beginning of the layer. Make sure there’s an existing <code>G92 E0</code> that resets the extruder distance, and the layer starts from a reset extruder position, you don’t want it to frantically dump a bunch of plastic on your print at the first extrude command (that’s one danger of resuming in in the middle of a layer).</p>
<p>Get everything heated up before you hit print, home the X and Y, stay in that position, and prime the nozzle. You can even hold something flat under the nozzle to keep it primed while you start the print, and have some tweezers handy to catch the goober on the hot end, so it doesn’t wipe it on your print. It helps to have a retract move when you begin, many slicers have a retract move when it advances to the next layer, you may want to start your G-code on that line if it’s before the line with the <code>G1 Z</code> [your layer height].</p>

CC BY-SA 4.0
2022-01-09T21:11:29.483Z
Thank you @ChinchillaWafers. Your answer saved a huge print on my Ender-3 V2.
My printer ran out of filament because the filament knob touched the led bar I attached to the top of the printer. After I cancelled the print, the printer still knew its current position so I was able to use 'Move Z-axis' to find the exact height I should start at.
Jeroen Vermeulen
CC BY-SA 4.0
2021-05-09T20:48:58.893Z
2021-05-10T17:30:44.460Z
2021-05-10T17:30:44.460Z
ChinchillaWafers
<p>I bought a Vivedino T-Rex 3 not realizing it doesn't have continue after power failure.  I am over it.  What I usually do is keep the part away from the home position so if it crashes I can continue without crashing the head during z home.  I measure the height of what printed open the G-code and remove the layers before the layer with that Z height, then run <code>G28 X Y</code>  to get away from the print.  Then run <code>G28 Z</code>.  But the T-Rex has a Bltouch and it goes to the middle of the bed to home the Z-axis. This is due to something called &quot;Z safehoming is enabled&quot;.  I don't want to change the T-Rex Marlin firmware. Is there a way to tell it when I am doctoring up the G-code to home the Z at at y = 5 mm x = 200 mm?</p>

<g-code><bltouch>
How do I change Z safe homing coordinates in the G-code , not in Marlin
Kirk D
# How do I change Z safe homing coordinates in the G-code , not in Marlin

(Asked by: username_0 on 2021-05-09)

I bought a Vivedino T-Rex 3 not realizing it doesn't have continue after power failure. I am over it. What I usually do is keep the part away from the home position so if it crashes I can continue without crashing the head during z home. I measure the height of what printed open the G-code and remove the layers before the layer with that Z height, then run `G28 X Y` to get away from the print. Then run `G28 Z`. But the T-Rex has a Bltouch and it goes to the middle of the bed to home the Z-axis. This is due to something called "Z safehoming is enabled". I don't want to change the T-Rex Marlin firmware. Is there a way to tell it when I am doctoring up the G-code to home the Z at at y = 5 mm x = 200 mm?

**Tags:** g-code, bltouch


---

## 1 answers

### Answer by username_1 on 2021-05-09. Score: 6

Don’t home the Z. Rather measure the height of your print to continue at with calipers. Or with detective work in your G-code preview, finding the layer your print stopped at and finding the Z height of that layer. The direction of the infill can be a clue. Then carefully lower your Z-axis until your nozzle is at the right height for your next layer (so get the nozzle .2 mm above your printed layer if you’re doing .2 mm layers).

Edit your print G-code to change `G28`, to be `G28 X0 Y0`, so that it only homes X and Y, not Z. Erase any line with `G29` (auto-leveling routine), or it will crash into your print. After the `G28 X0 Y0` line, enter `G92 Z`[your starting Z layer height in mm] that spoofs the Z position to the 3D printer, and it shouldn’t need to home. Then edit the rest of the G-code to start at the next layer of your resumed print.

Leave all the beginning commands that do setup, temperature, and erase the lines beginning with the movement, lots of `G1` commands. Find the `G1 Z`[your resumed layer height] command and begin there, that’s the beginning of the layer. Make sure there’s an existing `G92 E0` that resets the extruder distance, and the layer starts from a reset extruder position, you don’t want it to frantically dump a bunch of plastic on your print at the first extrude command (that’s one danger of resuming in in the middle of a layer).

Get everything heated up before you hit print, home the X and Y, stay in that position, and prime the nozzle. You can even hold something flat under the nozzle to keep it primed while you start the print, and have some tweezers handy to catch the goober on the hot end, so it doesn’t wipe it on your print. It helps to have a retract move when you begin, many slicers have a retract move when it advances to the next layer, you may want to start your G-code on that line if it’s before the line with the `G1 Z` [your layer height].

> **Comments:**
> **username_2**: Thank you @username_1. Your answer saved a huge print on my Ender-3 V2. My printer ran out of filament because the filament knob touched the led bar I attached to the top of the printer. After I cancelled the print, the printer still knew its current position so I was able to use 'Move Z-axis' to find the exact height I should start at.  

---

