这是延伸的方法- (setq sslst (vl-remove-if-not '(lambda (x) (= (type x) 'ENAME)) (mapcar 'cadr (ssnamex (ssget)))))
- (foreach ty sslst
- (setq pt1 (vlax-curve-getStartPoint ty))
- (setq pt2 (vlax-curve-getEndPoint ty))
- (command "_extend" "" (list ty pt1) "")
- (command "_extend" "" (list ty pt2) "")
- )
或者这样
- (setq ty0(car(entsel "\n选择外框:")))
- (setq sslst (vl-remove-if-not '(lambda (x) (= (type x) 'ENAME)) (mapcar 'cadr (ssnamex (ssget)))))
- (foreach ty sslst
- (setq pt1 (vlax-curve-getStartPoint ty))
- (setq pt2 (vlax-curve-getEndPoint ty))
- (command "_extend" ty0 "" (list ty pt1) "")
- (command "_extend" ty0 "" (list ty pt2) "")
- )
|