Point location entered incorrectly due to tolerance

I am making API program to make rack gears.

In my program I calculate point locations and make lines.

I found wrong lines appears in some small scale model.

When the rack module is 1 mm, the coordinate of red marked point in figure shoule be -0.42, 1.0 mm.

But it is made to -1.24, 0 mm.

I think it is problem of point tolerance. As you know Solidworks API handles dimension values by meter.

So 0.42 is actually 0.00042 in program.

So I made it as 10 times bigger model and scale it to 0.1 and got right model. (Blue colored solid body in figure)

One workaround is select part template for very small scale.(Like part 0001 mm and smaller) But this is program so I am not sure users of this program always select that template.

Is there any way to avoid this problem?

SolidworksApi/macros