TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: civil.eng on June 13, 2021, 09:30:19 AM
-
Hello everyone,
There is a problem with vlax-curve functions with 3Dpolyline, the attached file I wanted to use GetParamAtPoint function but it gives nil for some points while there is no problem with polyline and it occurs only with 3Dpolyline :
(defun c:ff ()
(setq obj (vlax-ename->vla-object (car (entsel))))
(setq pt (getpoint))
(vlax-curve-getparamatpoint obj pt)
)
-
(defun c:ff ()
(setq obj (vlax-ename->vla-object (car (entsel))))
(setq pt (getpoint))
(vlax-curve-getparamatpoint obj (vlax-curve-getclosestpointto obj (trans pt 1 0)))
)
HTH., M.R.
-
Thanks, but your codes didn't work. Did you try it on the file?
-
Indeed, sometimes CAD just won't work as expected... I moved 3dpoly, point at middle of segment, tried several times and at the end it worked... Sometime you just have to nudge things a bit to make it work - that's CAD (it happens from time to time, for ex. intersectwith method doesn't work if entity is far away from origin 0,0,0 - this isn't such a case, you just have to do something on entity that behaves buggy...)
-
Also here returns nil
Work around it via retrieving the coordinates of that targeted polyline then sort them to nearest distance to pt with x and y only without Z.
-
This is a known bug with the vlax-curve-* functions when the target entity is far from the origin - the below presents a possible workaround for you to consider:
(defun c:test
( / b e o p v x
) )
)
)
)
)