This is why I call it muddling my way through it. Same as I was doing years ago with Mach3 scripts.
I borrowed an unused field (87)
It does work.
Code:
string PierceHeight = AS3.Getfield(87);
exec.Code("G31 Z -40 F1000");
while(exec.IsMoving()){}
AS3.Setfield(-1.5, 99);
AS3.Validatefield(99);
exec.Code("G01 Z" + PierceHeight );
EDIT: There is something funny going on. When I post code, bits of it get dropped.
When I refresh the page it is correct and then a second later parts of it disappear. What's going on?
Looked at the same page in the browser on my android tablet. All shows OK.
Both Firefox and Chrome on the PC drop parts of the code which then means it does not make sense. Always the same bits.