亲测,好用,好评,略微美中不足的是没处理局部变量 - (defun C:TAG2TXT(/ sset num itm hnd ent new dolst grp addto)
- (setq sset (ssget ' ((0 . "ATTDEF"))))
- (setq num (sslength sset) itm 0)
- (while (< itm num)
- (setq hnd (ssname sset itm))
- (setq ent (entget hnd))
- (setq new ' ((0 . "TEXT")))
- (setq new (append new (list (cons 1 (cdr (assoc 2 ent))))))
- (setq dolst (list 7 8 10 11 39 40 41 50 51 62 71 72 73))
- (foreach grp dolst
- (setq addto (assoc grp ent))
- (if (/= addto nil)
- (setq new (append new (list (assoc grp ent))))
- )
- )
- (entdel hnd)
- (entmake new)
- (setq itm (1+ itm))
- )
- (princ)
- )
|