- (defun c:tt ()
- "延伸修剪处理"
- (while (and (setq e1 (entsel "\n选择固定边线: "))
- (setq e2 (entsel "\n选择延伸边线: "))
- )
- (setq s1 (car e1)
- s2 (car e2)
- pt (cadr e2)
- )
- (command "extend" e1 "" e2 "")
- (setq p1 (vlax-curve-getStartPoint s1)
- p2 (vlax-curve-getEndPoint s1)
- lst (list p1 p2)
- lst (vl-sort lst'(lambda (x y) (< (distance x pt) (distance y pt))))
- p0 (car lst)
- )
- (command "trim" e2 "" (list s1 p0) "")
- )
- (princ)
- )
|