jxlsp发表于2008-10-6 12:44:00这样好象不重叠的块也要删除了. 是要删除重叠多余的,重叠处只留一个吗?这样可以吗- ;删除重复块 晓东 zxq0220 2008.7.11
- (defun c:BKILL ()
- (setvar "CMDECHO" 0)
- (if (setq ss (ssget "X" '((0 . "INSERT"))))
- (progn
- (setq i 0 ess (ssadd))
- (repeat (sslength ss)
- (setq s1 (ssname ss i)
- ent (entget s1)
- j 0
- ptlist '()
- ss1 (ssget "X" (list '(0 . "INSERT") (assoc 2 ent))))
- (if (> (sslength ss1) 1)
- (repeat (sslength ss1)
- (setq en (ssname ss1 j))
- (setq pt (cdr (assoc 10 (entget en))))
- (if (member pt ptlist) (setq ess (ssadd en ess)) (setq ptlist (cons pt ptlist)))
- (setq j (1+ j))
- )
- )
- (setq i (1+ i))
- )
- (command ".erase" ess "")
- ))
- (setvar "CMDECHO" 1)
- (princ)
- )
|