// Go to Zero with safeZ if(exec.GetXpos()==0 && exec.GetYpos()==0 && exec.GetZpos()==0) { return; // if all position DROs are already zero then return } string feedrate = AS3.Getfield(867); exec.Getactualoffset(); double safeZ = exec.mainform.UCsetup.UCset.Generalsettings.SafeZ; double Softlimitsrelative = exec.mainform.UCsetup.UCset.Axis[2].UC100axis.SoftLimitP - exec.ofc.Wzval - exec.ofc.TOZval - exec.ofc.G92zval; if(exec.mainform.UCsetup.UCset.Generalsettings.Enablesoftlimits) { if(safeZ>Softlimitsrelative) { safeZ = Softlimitsrelative; if(exec.GetXpos()!=0 || exec.GetYpos()!=0) { DialogResult result = MessageBox.Show(exec.mainform.MSG.Message[45], "Confirmation", MessageBoxButtons.YesNo); if(result == DialogResult.No) { return; } } } } while(exec.IsMoving()){} int originaldistancemode = exec.actualdistmode; // remember the distance mode int originalmodalmode = exec.actualmodal; // remember the modal mode exec.Code("G90"); // Set system to absolute distance mode exec.Wait(100); if(exec.GetXpos()!=0 || exec.GetYpos()!=0) { if(exec.GetZpos()