PDA

View Full Version : How to detect order of points selection?



Nitisara
02-13-2006, 10:10 AM
Hello!

Interesting, is there any way to detect order of points selection in Modeler? For example, I want to know which point was selected first, which was selected second, and so on...

Matt
02-13-2006, 12:23 PM
As far as I'm aware the points[] array has them stored in the order they were selected.

So ...

// Total points selected (in order)
selected_points = editbegin();

points[1]; // First point, not '0' as you would think (unless I'm wrong, but my scripts seem to work with this being so)

points[2]; // Second point etc.

points[selected_points]; // Would be the last point

Nitisara
02-13-2006, 07:13 PM
Thank you Matt for reply!

Although in LScript it works a bit different, but your example pushed me to test pointScan() function, which really returns points IDs, beginning from selected points, and in their selection order.

:thumbsup:

Matt
02-14-2006, 12:17 PM
Doh, I forgot you code in C!!! :)

Glad it nudged you in the right direction though!

PICTRIX
02-15-2006, 02:42 AM
Hi ,

PointScan() teaches the first the selected point the first.
It teaches in selection the order.
It might be the order of making when there is no selected point.

Nitisara
02-15-2006, 02:57 AM
Hi ,

PointScan() teaches the first the selected point the first.
It teaches in selection the order.
It might be the order of making when there is no selected point.
Hi PICTRIX san!
Exactly! When something is selected, it goes selected first (in selection order).

PICTRIX
02-15-2006, 03:07 AM
Yes.
Only the number of selection points is scanned in the order.
Afterwards, it is point information on the remainder.