另一种方法是在最近的参数处添加绿点。
- (defun c:Test (/ s e pr p pt a b)
- ;; Tharwat 2014. cadtutor ;;
- (if (and (setq s (entsel)) (eq (cdr (assoc 0 (entget (setq e (car s))))) "LWPOLYLINE"))
- (progn (setq pr (vlax-curve-getparamatpoint (car s) (setq p (vlax-curve-getclosestpointto (car s) (cadr s)))))
- (if (< (distance p (setq a (vlax-curve-getpointatparam (car s) (fix pr))))
- (distance p (setq b (vlax-curve-getpointatparam (car s) (1+ (fix pr)))))
- )
- (setq pt a)
- (setq pt b)
- )
- (entmakex (list '(0 . "POINT") (cons 10 pt) '(62 . 3)))
- )
- (princ "\n Nothing selected or not a Polyline <!>")
- )
- (princ)
- )
- (vl-load-com)
|