- ;;假设S1 & S2 为3DPOLY & NOT CLOSED
- ;;Usage: (LX (car (entsel)) (car (entsel)))
- ;;改一下跟重写一样
- (defun LX (S1 S2 / PT_L L_L1 L_L2)
- ;;只保留了下列
- ;;------------------------------------------------------------------
- (defun 3DLIST (ENTNAME / CBIAO BIA ENTNAME LORPL)
- (setq LORPL NIL)
- (while (/= LORPL "SEQEND")
- (setq ENTNAME (entnext ENTNAME))
- (setq BIA (entget ENTNAME))
- (setq LORPL (cdr (assoc 0 BIA)))
- (if (/= LORPL "SEQEND")
- (setq CBIAO (cons (cdr (assoc 10 BIA)) CBIAO))
- )
- )
- CBIAO
- )
- (defun DO_IT1 (PT_L / PP)
- (command "3dpoly")
- (foreach PP PT_L (command PP))
- (command)
- (command "_.erase" S1 S2 "")
- )
- ;;-------------------------------------------------------------------
- (if (not (equal S1 S2))
- (progn
- (setq L_L1 (3DLIST S1))
- (setq L_L2 (3DLIST S2))
- (cond
- ((equal (last L_L1) (last L_L2))
- (setq
- PT_L (append (reverse (cdr (reverse L_L1))) (reverse L_L2))
- )
- (DO_IT1 PT_L)
- )
- ((equal (car L_L1) (last L_L2))
- (setq PT_L (append (reverse (cdr L_L1)) (reverse L_L2)))
- (DO_IT1 PT_L)
- )
- ((equal (car L_L1) (car L_L2))
- (setq PT_L (append (reverse L_L1) (cdr L_L2)))
- (DO_IT1 PT_L)
- )
- ((equal (last L_L1) (car L_L2))
- (setq PT_L (append L_L1 (cdr L_L2)))
- (DO_IT1 PT_L)
- )
- )
- )
- )
- (princ)
- )
|