Notifications
Clear all

[Closed] SNAP – get index of snapped segment

First, something that I found a while ago – the maxscript reference file is not updated regarding the SNAP.
This is from the maxscript help file.

snapMode.numOSnaps
A System Global which contains the number of OSnaps as an integer.

Read only.

Currently there are 6 sets of OSnaps – see below of details.

Available in 3ds Max 7 and higher.

But, in 3dsMax 2014, 2015, 2016 there are 7 sets of OSnaps. “Point Cloud Objects”-“Point Cloud Vertex” is the new snap set. You can check this using the provided in the mxs help file function:


for i = 1 to snapmode.numOSnaps do
(
	format "%: name: \"%\"
" i (snapmode.getOSnapName i)
	for j = 1 to (snapmode.getOSnapNumItems i) do
	format " %: name: \"%\"; tooltip: \"%\"; state: %
" j \
	(snapmode.getOSnapItemName i j) \
	(snapmode.getOSnapItemToolTip i j) \
	(snapmode.getOSnapItemActive i j)
)

Now, the main question – when SNAP is set to Edge/Segment is is posible to get directly the index of the snapped segment without checking all segments in the scene? For example i have two lines and my cursor is snapped to segment 4 of spline 2. I know that maxscript gives only the point3 coordinate of the snapped point. Maybe using SDK?