[Solved] How to get position [x,y,z] of vertex of a Line
Hi,
I'm completely new to Maxscript (and to 3ds max), and I'm trying to do something that sounds very simple but for some reason I cannot find the solution online. Namely, I want to move an object to the position of a selected vertex on a spline. All I'm missing is the script to find the [x,y,z] position of a selected vertex. Can anyone help me out?
Comments
...
This is the function that you looking for
getKnotPoint shape spline_index_integer knot_index_integer
Easy draw a spline, select it and run this code to get print knot positions
See the result in the listener
Also read this topic from MXS Help
http://docs.autodesk.com/3DSMAX/15/ENU/MAXScript-Help/index.html?url=fil...
bga
Thank you for the quick
Thank you for the quick response!
This brings me one step closer to what I want, but I'm not sure I'm there yet. So this code basically gives me all the coordinates of vertices in a selected spline (is that right? I'm still reading through the Maxscript help in Autodesk). But what I'm looking for is just the coordinate of the one vertex I have selected in the spline. I then want to put that coordinate in a point3 variable, so I can then position my object on that location.
eg.:
obj.pos = vert_coordinate
Is there a simple way to do this?
...
Yup.
If you have shape with one spline and only one knot selected then
If your shape contains multiple splines then you need to use for-loop.
All about splines you have in link that I've posted earlier.
bga
When I run this script I get
When I run this script I get the following error:
...
bga
This is perfect! Thank you.
This is perfect! Thank you.