New_Prim = addprim(geoself(), "polyline");
addvertex(geoself(), New_Prim, 0); // 0 is point number 0
addvertex(geoself(), New_Prim, 1); // 1 is point number 1
Just keep adding the function addvertex with a new corresponding point number and same ‘New_Prim’ number to keep
those points belonging to same primitive.
You may want to create ‘for’ loop/s for many points using the index of the loop as the point numbers.
And create your own sorting algorithm beforehand to get the order of points you want before passing on to the ‘for’ loop for connection.
Of course you can put your ‘sorting’ algorithm within the for loop itself if you want.
And/or if you need different sets of points belonging to different primitives, create groups of points as well.