Move RefAll to fixture 0,0 is indeed a solution, didn't think about it....
(And when I think about it, rotation also has to be taken in account

)
Taking the time and write some vb code to calculate machine coords to work coords is more elegant, I think.
And that has to be done only once...
I wonder IF you could apply the surface offsets to the axis correction map or possible use the data to create an offset table of Gcode variables.
Not sure what you mean with this, english is not my native language...
The "z-control" program I wrote functions on itself, outside Mach.
My knowlege of vb is far better than my knowledge of Mach, it's variables, g-code etc
So I thought this was the way to go.
All I need is text-file (CSV, Like M40) of the surface scan and the original g-code.
Those are loaded in z-control.
z-control outputs adjusted g-code with interpolated Z's and broken G1 G2 and G3 parts.
It works. Even with G68 and my crappy button probing script.
Or with Grahams probing g-code and M40 without G68.