Hi Klaus,
I ran you code and digged a Little bit deeper into that.
As soon as you create a polyline (doc.NewPolyline) FM creates this Default 3 Point line.
Assigning NumPoints and Points later has no effect anymore.
This is why you get this Kind of line. Your Point calculation looks god.
So there must be another way to change the point settings of a polyline.
Perhaps I find some time this evening...
Markus