View Full Version : points method bug?

10-15-2009, 07:08 AM
I'm attempting to write an lscript and I feel like I'm fighting LW yet again. First of all, I wanted to be able to use a curve in my calculations, but it seems that you cannot access curve information in Layout at all?
Anyway, I switched to a layer of points to iterate over in the second layer (the curve still being in the first layer for reference purposes)

I select the desired object in layout by using this in the requeter

cItem = ctlmesh_items("Item",item); //no '_' but the forum filter blocks it otherwise
item = getvalue(cItem);

So, I then try to iterate over the points using this

pc = item.pointCount();
for(i=1; i <= pc; i++)
pnt = item.points[i];
nPos = item.position(pnt);

The point count, pc, is correct (i.e. it matches the amount of points in the mesh object selected, but item.points[i] always reports back the points from layer 1 first.
E.g. If layer 1 has 20 points, layer 2 has 40 points, even though the 'item' variable will be a reference to the layer 2 mesh, a call to item.points[10] will give me the 10th point from layer 1.

Is this a bug or am I doing something wrong?