http://blog.csdn.net/jingxuan84/article/details/8668507
论坛也有
- ;; 属性转文本
- (defun C:TAG2TXT ()
- (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)
- )
|