希望这一个,你正在寻找。。。。
- (defun c:Test (/ e i n sn ss strings)(vl-load-com)
- ;;; Tharwat 28. march. 2012 ;;;
- (if (setq ss (ssget "_:L" '((0 . "INSERT") (66 . 1))))
- (repeat (setq i (sslength ss))
- (setq sn (ssname ss (setq i (1- i))))
- (setq n (entnext sn))
- (while (not (eq (cdr (assoc 0 (setq e (entget n)))) "SEQEND" )
- )
- (if (not (member (strcase (cdr (assoc 1 e))) strings))
- (setq strings (cons (strcase (cdr (assoc 1 e))) strings ))
- (vla-delete (vlax-ename->vla-object n))
- )
- (setq n (entnext n))
- )
- (setq strings nil)
- )
- (princ)
- )
- (princ)
- )
|