Hi Graham
Thanks for the tip. I have done the following.
' G1X [Tan[Ang / 2]]*[R*[1 - Cos[#203]]] A#203
'*******************************
Setvar(101, tan(Ang/2))
Setvar(102, R)
Setvar(103, D)
Setvar(104, Num)
Setvar(105, ADiv)
Code "G1 X [#101*[#102 *[1-cos[#104]]]] A#104"
Code "#104=[#105+#104]"
It seems to not be happy with the 1-cos[#104] part of the macro.
Not sure how to reduce this into a single Var because with the line just after that #104 gets update by an increment each time for the rest of the cycles the sub is running.
Thanks for your help in advance.
Regards
Deon.