Different lines and circles every time when run the macro file

Hi all. I have very interesting problem with one of my macro file. I have made serial of lines and circles with formulas. When I run the file, the SolidWorks makes them different every time. On the fourth time it makes them right. Can somebody explain to me what's happening.

SolidworksApi macros