Darc,
You can do this, its simple.
I can think of two ways.
1. If you are always using the same diameters (for example 10 different diameters), do a screen (or wizard) with 10 buttons, each with the VB code for each diameter, so you will have a button for 20mm, a button for 16mm, and so on and so forth. You will have to use the sintax required to run a gcode in VB.
2. If you have a large number of diameters and it is prohibitive to have a button for each, make a screen (or wizard) , with a DRO in which you can input the diameter of the bar you want to cut. then Just have a button that reads that DRO and inserts it in the #1 variable you proposed.
Hope that gets you started.
Regards
Fernando