- (defun C:TEST ( / pl pt par )
- (princ (setq pl (car (entsel "\nSelect pline entity")))) ;; picking curve 'ename (pline belongs to curve family entities)
- (princ (setq pt (vlax-curve-getPointAtDist pl 200))) ;; calculating point at dist 200 from start point of curve if curve is larger than 200 units, or calculating end point if curve is smaller than 200 units
- ;; (vlax-ename->vla-object pl) ;; - unnecessary line (vlax-curve-xxx) functions work with both 'ename and 'vla-object, but it's better to use 'ename because it's faster approach and with less typing
- (princ (setq par (vlax-curve-getparamatpoint pl (vlax-curve-getclosestpointto pl pt)))) ;; calculating parameter value of point pt on curve and if point lies on curve it should be somewhere in between (vlax-curve-getstartparam pl) and (vlax-curve-getendparam pl) and if pt is previously calculated to be exactly end point of curve - curve is smaller than 200 units => par= (vlax-curve-getendparam pl)
- (princ)
- )
|