Jump to content

How can I globally change attribute color


Recommended Posts

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!

Link to comment
Share on other sites

  • Replies 25
  • Created
  • Last Reply

Top Posters In This Topic

  • yrnomad

    7

  • anewman

    4

  • Bogbadbob658

    3

  • GE13579

    2

Top Posters In This Topic

Posted Images

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?

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. th_fbc23627.gif

Link to comment
Share on other sites

  • 5 months later...

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

Link to comment
Share on other sites

  • 5 months later...
  • 2 months later...

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

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...