@JoergS5 Looks OK to me.
G29 S1 P"heightmap.csv" ; Load the height map from file and activate bed compensation.
G90 ; use absolute coordinates
M83 ; extruder relative mode
M98 P"0:/sys/G828.g" ; home if not homed
M98 P"0:/sys/G832.g" ; if not already leveled, level bed and re-home Z
; prime nozzle
G1 X0 Y0 F99999.0 ; Go home
G1 Z0.15 ; lower extruder
G1 X2 Y20 Z0.3 F5000.0 ; move to start-line position
G1 X2 Y200.0 Z0.3 F1500.0 E15 ; draw 1st line
G1 X2 Y200.0 Z0.4 F5000.0 ; move to side a little
G1 X3 Y20 Z0.4 F1500.0 E30 ; draw 2nd line
G92 E0.0
And the two calls look clean, too:
; G828.g
; Conditional variant of G28 home command.
; Homes all axes if not already homed.
if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
G28
; G832.g
; Conditional variant of G32 bed command.
; Perform bed leveling if not already leveled.
if move.calibration.numFactors == 0 ; if leveling has not yet been performed...
G32 ; level bed
G28 Z ; re-home Z
else
echo "Bed already leveled. Skipping..."