Here's a interesting measurement Macro from my Lathe.
I guess issued by G65 P9018 X xa;
O9018
#1=#4001
G00 X[24-10.0];
G31 X[#24+5.0];
IF[ABS[#5061-#5081-#24]LT5.0]GOTO 9018;
#3000=80(PS);
N9018#4=BIN[BCD[#4120]AND255];
G10P#4X[#5061-#24];
G #1 M99;
I thinking it could be made a little bit better becuase what it seems to do is some tolerance checking and X axes setting of the automatic tool offset.