品茗新秀 发表于 2015-1-30 01:18 
如果有多个,框选就更好了
 - (defun c:tt (/ i ss)
- (setq ss (ssget '((0 . "INSERT"))))
- (if (not (null ss))
- (progn
- (setq i 0)
- (repeat (sslength ss)
- (detachattrib (ssname ss i))
- (setq i (+ i 1))
- )
- )
- )
- )
- (defun detachattrib (ent / dxf txt)
- (while
- (and (setq ent (entnext ent))
- (setq dxf (entget ent))
- (/= "SEQEND" (cdr (assoc 0 dxf)))
- (= "ATTRIB" (cdr (assoc 0 dxf)))
- )
- (setq txt (subst '(0 . "TEXT") '(0 . "ATTRIB") dxf)
- txt (vl-remove-if '(lambda (e) (member (car e) '(-1 330 5 2 70 73 74 280))) txt)
- )
- (entmake txt)
- (setq dxf (subst '(1 . "") (assoc 1 dxf) dxf))
- (entmod dxf)
- )
- )
哪里用到什么子函数? |