how to get selected knot position ?

Hello as title says, I wonder how to get selected knot position ?

new_spline = $
sk = getKnotSelection new_spline 1

skp = getKnotPoint $ 1 ?
aaa = addKnot new_spline 1 #corner #curve skp
updateshape new_spline

Thanks.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
titane357's picture

Thanks Miauu... If I

Thanks Miauu...
If I understand well, you create an array of the one selected knot, so you know which index is used by this knot (index =1)
very clever... I hate arrays, but so powerfull...
so I have what I want : create a new knot at the end of my spline (don't work for begin of the spline)

new_spline = $
selKnotsArr = getKnotSelection new_spline 1
-- check if only one knot is selected
if selKnotsArr.count == 1 do
(
skp = getKnotPoint new_spline 1 selKnotsArr[1]
aaa = addKnot new_spline 1 #corner #curve skp
updateshape new_spline
setKnotSelection new_spline 1 #(aaa)
)

miauu's picture

.

I did not create the array. getKnotSelection returns the selected knots as array.:)

miauu's picture

.

(
	new_spline = $
	selKnotsArr = getKnotSelection new_spline 1
	--	check if only one knot is selected
	if selKnotsArr.count == 1 do
	(
		skp = getKnotPoint new_spline 1 selKnotsArr[1]
		aaa = addKnot new_spline 1 #corner #curve skp
		updateshape new_spline
	)
)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.