Hi,
if the number of the spindle tool the number of the tool offset, you can read out the active spindle tool with #3026 and determine the actual tool diameter from it.
#7=#[3200+#3026] alternatively #7=#[2400+#3026]+#[2600+#3026].
Otherwise this should also be done using the last programmed D-parameter (#4107).
It is important here that the D must have been called at least once before the macro call.
#7=#[3200+#4107] alternatively #7=#[2400+#4107]+#[2600+#4107].
I would map the D-parameter in the macro call as an optional parameter.
G65 P.. X.. Y.. Z.. I.. [D..} {F..}
..
N10 IF [#7 NE #0] GOTO12
N11 #7=#3026
N12…
greetings eckitsch.