我打算使用vlax curve getdistatpoint函数,我不知道为什么我改变了主意,尽管我在之前的第一篇文章中的第一个代码应该按照OP的要求工作。
无论如何,这很容易处理,以涵盖其他形状的LWpolyline李的例子。
- (defun c:Test (/ s o lst)
- (if (and (setq s (entsel "\n Pick a LWPOLYLINE :"))
- (eq (cdr (assoc 0 (entget (setq o (car s))))) "LWPOLYLINE")
- (mapcar '(lambda (p)
- (if (eq (car p) 10)
- (setq lst (cons (cdr p) lst))
- )
- )
- (entget o)
- )
- )
- (if (> (vlax-curve-getdistatpoint o (vlax-curve-getclosestpointto o (cadr s)))
- (vlax-curve-getdistatparam o (vlax-curve-getendparam o))
- )
- (setq lst (reverse lst))
- )
- )
- lst
- )(vl-load-com)
|