View Full Version : How can I globally change attribute color
yrnomad
27th Nov 2007, 08:06 pm
Howdy folks
I've got a project with an architect who doesn't use color by layer on entities and attributes. I've got a routine to change all entities and entities within blocks to color bylayer, but this doesn't help with the existing blocks with attributes in them.
Can anyone supply code or tell me how to quickly change the attributes with a window or by block to be color bylayer?
Many thanks!
GE13579
27th Nov 2007, 08:26 pm
Could you use QSELECT to select what you're after and then change everything in the properties window to bylayer?
yrnomad
27th Nov 2007, 08:43 pm
Could you use QSELECT to select what you're after and then change everything in the properties window to bylayer?
When I use qselect my options seem to only relate to the properties of the block or the value of the attribute.
Am I not seeing the option you are thinking of?
GE13579
27th Nov 2007, 09:05 pm
I think I might have missed a part of your post, sorry I'm not all that good with all the terminology yet :? ...
How about BEDIT, REFEDIT or ATTEDIT, then select the block and then try properties... I might need some help here myself!
An alternative to REFEDIT in mechanical (not sure if it's the same across the board), is to double click the block. Failing that I'm not sure I'll be of any more use sorry. :oops:
lpseifert
27th Nov 2007, 09:21 pm
Bedit, change the color of the attributes, Save block definition, Close block editor. Then Attsync the block.
You can only Bedit and Attsync one block at a time, so if there are a lot of different blocks it could be time consuming.
Bogbadbob658
27th Nov 2007, 09:51 pm
Try 'battman' this will allow you to global change the properties to the attribute without changing the values however it will change all of the properties to match so if properties of an attribute has been individualy altered it will be overwritten.
yrnomad
27th Nov 2007, 10:41 pm
The attsync and battman commands seemed to work initially, but then I found text that seemed to have mirrored. Any idea why?
For example, one of my base plans is grid lines/bubbles for the building. About a third of the 90 bubble's have attributes that are set to yellow for the color while the bylayer color should be 9. This is of course is just one of the blocks that is in this drawing which is one base plan out of close to a hundred.
I used to work for a company that had a routine (on AutoCAD 2006) that would go through and change all entities to color bylayer, including the attributes then regen. I'm wishing for something similar.
SLW210
27th Nov 2007, 10:45 pm
Did you try Modify>Change to ByLayer or _SETBYLAYER on the command line?
yrnomad
27th Nov 2007, 10:58 pm
I didn't find the Modify>Change to ByLayer option, and I get the response I get from typing in _setbylayer is
Command: _setbylayer
Unknown command "SETBYLAYER". Press F1 for help.
SLW210
27th Nov 2007, 11:06 pm
Must be new to 2008. I thought 2007 might have it, sorry. :?
Maybe you need an upgrade.:thumbsup:
You may be able to find a LISP to do it. I will search around and see what I can find. http://smg.photobucket.com/albums/v319/tankexmortis/Smileys/th_fbc23627.gif
yrnomad
27th Nov 2007, 11:13 pm
Thanks
I'll be getting 2008 next week, so I'll put that on my list to "Try on 2008".
Marty Cuerdon
5th May 2008, 03:10 am
I just completed an AutoLisp routine as a class final project that changes all existing block attribute colors to ByLayer. Warning: The routine does not change the original block definition so attribute colors for new instances of block insertions will not be ByLayer unless the original block attribute color has been modified.
;| ********************* Existing Block Attribution Color Modification Procedure *************************
This function steps through an existing drawing entity database one entity at a time, identifies
all Block Attributes with colors specified as other than ByLayer and modifies the color to ByLayer.
Written by: Marty Cuerdon, May 4, 2008, Part of Final Semester Project, CAD-249
Arapahoe Community College, Littleton, CO
Instructor: John Funderburk
Variables:
ENAME1 Entity Database Ename
EVAL1 Entity Property List of ENAME1
ENAME2 Block Attribute SubEntity Ename
EVAL2 SubEntity Property List of ENAME2
COLORNUM Pre-Existing Block Attribute Color Number
|;
(defun c:CATTEDIT ( / ENAME1 EVAL1 ENAME2 EVAL2 COLORNUM)
(setq ENAME1 (entnext)) ; Find name of 1st Entity in the Drawing Database
(while (not (null ENAME1)) ; 1st While used to step through the entire Entity Database
(setq EVAL1 (entget ENAME1)) ; Set the property list of the Entity to EVAL1
(if (= (cdr (assoc 0 EVAL1)) "INSERT") ; Test for Block instance entity type
(progn ; 1st Progn
(if (= (setq ENAME2 (entnext ENAME1)) nil) ; Step to next Entity in the Database
(exit))
(setq EVAL2 (entget ENAME2)) ; Set the property list of the Entity to EVAL2
(while (= (cdr (assoc 0 EVAL2)) "ATTRIB") ; 2nd While Test next entity o see if it it an ATTRIB
(cond
((= (assoc 62 EVAL2) nil) ; 1st Test for default Color ByLayer
) ; End 1st Test
((/= (assoc 62 EVAL2) 256) ; 2nd Test for Color other than ByLayer
(progn
(setq COLORNUM (assoc 62 EVAL2)) ; Set COLORNUM to Existing Color Number
(setq EVAL2
(subst '(62 . 256)
COLORNUM EVAL2)) ; Substitute Color ByLayer for Existing Color
(entmod EVAL2) ; Modify the Database
(entupd ENAME2) ; Update the Attribute on the Drawing
(setq ENAME1 ENAME2) ; Updates Entity Pointer to last Attribute
) ; Close progn
) ; Close 2nd Test
) ; Close cond
(if (= (setq ENAME2 (entnext ENAME2)) nil) ; Step to next entity in case it is another Attribute
(exit) ; Exits at the end of the entity database
(setq EVAL2 (entget ENAME2))) ; Updates Eval2
) ; Closes 2nd While
) ; Closes 1st Progn
) ; Closes if
(if (= (setq ENAME1 (entnext ENAME1)) nil) ; Step to next Entity in the Database
(exit)) ; Exits at the end of the entity database
) ; Closes 1st While
) ; Closes defun
dusko
6th May 2008, 01:26 pm
i like it :)
Lansky
15th Oct 2008, 10:15 am
Battman resolves all my problems.
In V2009 all the blocks with attributes are changed.
188, in my case. :shock:
anush
13th Jan 2009, 10:41 am
Use setbylayer command as given below
Command: setbylayer press the enter button now you will get
Select objects or [Settings]: select the objects which you want to change the color back normal (Bylayer)
if you want to change all objects under the one layer then use the fillter command as follows
Command: filter press the enter button
select layer on the Select Filter puldown menu & select the layer which you want to change & press Add to List button then press apply button to Select objects now you give setbylayer command and just enter twice done.
Anush
archstudio.co.in
yrnomad
19th Jan 2009, 10:12 pm
Nice!
Thanks
anewman
29th Jan 2009, 02:57 pm
I have tried the command line options which have been suggested, and they all come back with:
Unknown command "XXXXXXX". Press F1 for help.
Does this not work in 2006LT? Is there any way in 2006LT that you can change the colour of text (attribute) which is in a block?
Thanks
GliderRider
30th Jan 2009, 07:33 pm
Battman worked beautifully for me in 2009. Thanks!
anewman
9th Feb 2009, 01:30 pm
This is still not working for me.
All I am trying to do, is change a block with text attribute which are yellow (as using a black backgroud) and when I want to print it in colour I want to change that blocks text to be printed in black. Is something else that I can set up like white to black to say if the colour is yellow on the screen and I print it out it will come out black if the rest of the drawing is in colour?
Thanks
Andy
Bogbadbob658
9th Feb 2009, 04:41 pm
Whilst you are waiting for a better answer you could try a workaround. Select everything that is drawn yellow and you want to be plotted in yellow and change the colour to a different colour. Then change your pen table to plot yellow in black and the new colour in yellow.
anewman
9th Feb 2009, 04:54 pm
Where abouts is the pen table?
Is the area you mean the one I have attached?
Thanks
Andy
file:///C:/DOCUME%7E1/ANDREA%7E2.NEW/LOCALS%7E1/Temp/moz-screenshot.jpg
wannabe
9th Feb 2009, 06:26 pm
Edit your plot style tables.
Bogbadbob658
9th Feb 2009, 09:41 pm
Are you using CTB or PST plotting? If you are not sure go as if to plot and check the file name in the top right hand corner. It will end in either ctb or pst. If you can't see the file click the > at the bottom right. If you are using a ctb file then click the button to the right of the file name. You can then edit the file. I would suggest you save it with a new name so as not to effect any other drawings. Sorry if I'm teaching you to suck eggs but I'm not sure of your level of ability.
anewman
10th Feb 2009, 09:46 am
Are you using CTB or PST plotting? If you are not sure go as if to plot and check the file name in the top right hand corner. It will end in either ctb or pst. If you can't see the file click the > at the bottom right. If you are using a ctb file then click the button to the right of the file name. You can then edit the file. I would suggest you save it with a new name so as not to effect any other drawings. Sorry if I'm teaching you to suck eggs but I'm not sure of your level of ability.
That worked prefectly. Thank you all very much for your help.
Andy
gil9166
9th Oct 2009, 04:08 pm
use "Super Purge" command and everything is by layer
Howdy folks
I've got a project with an architect who doesn't use color by layer on entities and attributes. I've got a routine to change all entities and entities within blocks to color bylayer, but this doesn't help with the existing blocks with attributes in them.
Can anyone supply code or tell me how to quickly change the attributes with a window or by block to be color bylayer?
Many thanks!
yrnomad
9th Oct 2009, 05:00 pm
That command wasn't recognized. How do you type it (i.e. superpurge; -superpurge...) Is it a custom lisp you have picked up somewhere else?
Powered by vBulletin™ Version 4.1.2 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.