请尝试以下操作:
- (defun c:boxed (/ vlax-list->3D-point i j ss e1 e2 o1 o2 iLst)
- ;; by Lee McDonnell ~ 03.12.2009
- (vl-load-com)
- (defun vlax-list->3D-point (lst)
- (if lst
- (cons (list (car lst) (cadr lst) (caddr lst))
- (vlax-list->3D-point (cdddr lst)))))
- (if (setq i -1 ss (ssget '((0 . "LINE"))))
-
- (while (setq j (1+ i) e1 (ssname ss (setq i (1+ i))))
-
- (while (setq e2 (ssname ss (setq j (1+ j))))
-
- (if (setq iLst
- (vlax-list->3D-point
- (vlax-invoke
- (setq o1 (vlax-ename->vla-object e1)) 'IntersectWith
- (setq o2 (vlax-ename->vla-object e2)) acExtendBoth)))
- (foreach x (list e1 e2)
-
- (if (< (distance (vlax-curve-getStartPoint x) (car iLst))
- (distance (vlax-curve-getEndPoint x) (car iLst)))
- (vla-put-StartPoint (vlax-ename->vla-object x) (vlax-3D-point (car iLst)))
- (vla-put-EndPoint (vlax-ename->vla-object x) (vlax-3D-point (car iLst)))))))))
- (princ))
|