hosannabizarre Posted June 23, 2010 Share Posted June 23, 2010 I greatly desire the following AutoCAD power: the ability to change the layer attribute of text nested in multiple blocks (of different names), using a lisp routine. It is possible to change the colour attribute of text nested in multiple blocks (of different names) using ATColour.lsp, which goes like this: ;; NOTE: this was written for my personal use only... ;; I only guarentee that it takes up disk space !! ; ERROR MESSAGE *********** (defun *error* (s) (if old_error (setq *error* old_error)) (princ) ) (defun None ( ) (command "") ) (defun C:ATC (/ NewV OldV ) (setq nmbr (strcase (getstring"\nEnter Number of Attributes to change: "))) (setq nmbr (atoi nmbr)) (setq cntr 0) ; repeat counter (setq NewV (strcase (getstring "\nEnter New Attribute Colour: "))) (command "attedit" "" "" "" "" "w" pause pause "C" NewV "") (setq cntr (+ 1 cntr)) (while (/= nmbr cntr) (if (= nmbr cntr) (none)) (if (/= nmbr cntr) (command "C" NewV "")) (setq cntr (+ 1 cntr)) ) ;while (if (= nmbr cntr) (none) (EXIT)) (EXIT) ) ;defun This is very efficient - you have to follow a few prompts. 1) You state the number of instances you want to update 2) You name the colour you want to apply 3) You drag out a selection, and nested text within that area will assume the colour attribute you specified. Try it out - it works great. If someone could help me work out a version of this routine to tackle the updating of the layer attribute, instead of the colour attribute, I would be profoundly grateful and impressed. Here's hoping someone has the smarts to crack this one - I'm still a total newb at this stuff. Thanks!! Quote Link to comment Share on other sites More sharing options...
Cazza Posted August 28, 2012 Share Posted August 28, 2012 Hi hosannabizarre, Your lisp routine is very useful and saves me a great deal of time, for that I thank you. I was wondering though, is there a way to select the colour as being bylayer rather than selecting a number value for it? Quote Link to comment Share on other sites More sharing options...
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.