The Courage Dog Posted March 7, 2010 Posted March 7, 2010 hi, is there any lisp routine that can automatically remove all fields inserted on text & titleblock attribiutes without opening each sheet file one by one. Your help is much appreciated. thanks. Quote
rkmcswain Posted March 7, 2010 Posted March 7, 2010 Not impossible to write, but so limited in purpose that I'm guessing it doesn't already exist. Quote
Lee Mac Posted March 7, 2010 Posted March 7, 2010 I'd be interested to see how this is approached, my first thought would be to remove the ACAD_FIELD dictionary object from the object in question, but with a quick test, this does not seem to be successful. Quote
The Courage Dog Posted March 8, 2010 Author Posted March 8, 2010 hi leemac, it sounds not clear to me, if you don't mind can you explain it further more please. sorry for this. thanks Quote
SteveK Posted March 8, 2010 Posted March 8, 2010 I can't find where I got this from, AND it doesn't work across layouts for some reason, but just a start: (defun C:Remove_Fields ( / del-field ss1 index item) (vl-load-com) (defun del-field (ent / edic elist etype obj val) (if (and (setq edic (cdr (assoc 360 (setq elist (entget ent))))) (dictsearch edic "ACAD_FIELD") ) (progn (setq obj (vlax-ename->vla-object ent) etype (cdr (assoc 0 elist)) ) (cond ((= etype "DIMENSION") (setq val (vla-get-textoverride obj)) (dictremove edic "ACAD_FIELD") (vla-put-textoverride obj val) ) ((= etype "MTEXT") (setq val (vla-get-textstring obj)) (dictremove edic "ACAD_FIELD") (vla-put-textstring obj val) ) (T (dictremove edic "ACAD_FIELD")) ) ) ) ) (if (setq ss1 (ssget "X" (list (cons 0 "TEXT,MTEXT,MULTILEADER,DIMENSION") (cons 67 1) ) ) ) (progn (setq index 0) (repeat (sslength ss1) (setq item (ssname ss1 index)) (if (del-field item) (entupd item)) (setq index (+ 1 index)) ) ) ) (if (setq ss1 (ssget "X" (list (cons 0 "INSERT") (cons 67 1) (cons 66 1) ) ) ) (progn (setq index 0) (repeat (sslength ss1) (setq item (ssname ss1 index)) (while (= (cdr (assoc 0 (entget (setq item (entnext item))))) "ATTRIB") (if (del-field item) (entupd item)) ) (setq index (+ 1 index)) ) ) ) (princ) ) 1 Quote
The Courage Dog Posted March 9, 2010 Author Posted March 9, 2010 hi SteveK, your lisp works perfect. thanks so much. Quote
SteveK Posted March 10, 2010 Posted March 10, 2010 hi SteveK, your lisp works perfect. thanks so much. Great! I just want to clarify it's not mine. And I didn't think it works perfect, I remember last time I used it it saved the same value of an attribute tag on the current layout throughtout all the layouts So just beware if you have multiple layouts. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.