+ Reply to Thread
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 26
  1. #11
    Senior Member yrnomad's Avatar
    Computer Details
    yrnomad's Computer Details
    Operating System:
    Windows 10 - 64 bit
    Computer:
    HP Z220
    CPU:
    Intel core I7 3.4GHz
    RAM:
    16 GB
    Graphics:
    nVidia GeForce 9600 GT w/dual monitor output
    Primary Storage:
    1 tb SATA
    Monitor:
    (2) 22" Acer LCD
    Discipline
    Electrical
    yrnomad's Discipline Details
    Occupation
    Drafting/Design Electrical contractor's shop
    Discipline
    Electrical
    Using
    AutoCAD 2017
    Join Date
    Aug 2007
    Location
    Vancouver, WA - USA
    Posts
    147

    Default

    Registered forum members do not see this ad.

    Thanks
    I'll be getting 2008 next week, so I'll put that on my list to "Try on 2008".

  2. #12
    Forum Newbie
    Using
    Architecture 2007
    Join Date
    May 2008
    Posts
    1

    Default CATTEDIT Modifies Existing Block Attribute Color to ByLayer

    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.

    Code:
    ;| ********************* 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

  3. #13
    Senior Member dusko's Avatar
    Using
    AutoCAD 2010
    Join Date
    Dec 2007
    Location
    Croatia - the land of grape and honey
    Posts
    210

    Default

    i like it

  4. #14
    Junior Member Lansky's Avatar
    Using
    AutoCAD 2008
    Join Date
    Oct 2007
    Posts
    11

    Default

    Battman resolves all my problems.


    In V2009 all the blocks with attributes are changed.


    188, in my case.

  5. #15
    Forum Newbie
    Using
    AutoCAD 2008
    Join Date
    Jan 2009
    Posts
    1

    Default follow the steps to get back your colour as by layer

    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

  6. #16
    Senior Member yrnomad's Avatar
    Computer Details
    yrnomad's Computer Details
    Operating System:
    Windows 10 - 64 bit
    Computer:
    HP Z220
    CPU:
    Intel core I7 3.4GHz
    RAM:
    16 GB
    Graphics:
    nVidia GeForce 9600 GT w/dual monitor output
    Primary Storage:
    1 tb SATA
    Monitor:
    (2) 22" Acer LCD
    Discipline
    Electrical
    yrnomad's Discipline Details
    Occupation
    Drafting/Design Electrical contractor's shop
    Discipline
    Electrical
    Using
    AutoCAD 2017
    Join Date
    Aug 2007
    Location
    Vancouver, WA - USA
    Posts
    147

    Default

    Nice!
    Thanks

  7. #17
    Forum Newbie
    Using
    AutoCAD LT 2009
    Join Date
    Jan 2009
    Posts
    5

    Default

    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

  8. #18
    Full Member GliderRider's Avatar
    Using
    AutoCAD 2009
    Join Date
    Nov 2008
    Location
    Canada
    Posts
    29

    Default

    Battman worked beautifully for me in 2009. Thanks!

  9. #19
    Forum Newbie
    Using
    AutoCAD LT 2009
    Join Date
    Jan 2009
    Posts
    5

    Unhappy

    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

  10. #20
    Senior Member Bogbadbob658's Avatar
    Computer Details
    Bogbadbob658's Computer Details
    Operating System:
    Windows 7
    Motherboard:
    Asus P8P67 LE
    CPU:
    Intel 2nd Generation Coreā„¢ i5-2500
    RAM:
    8GB 1333MHz Dual Channel DDR3 SDRAM
    Graphics:
    512MB Nvidia GeForce Quadro FX 580
    Primary Storage:
    1TB Samsung F3 SATA 7200rpm 32MB Cache
    Monitor:
    24" Iiyama LCD Monitor - Full HD 1920x1080
    Using
    Architecture 2013
    Join Date
    Aug 2007
    Location
    Gloucester UK
    Posts
    325

    Default

    Registered forum members do not see this ad.

    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.

Similar Threads

  1. When I change the color the dimensions change!
    By Mark Costantino in forum AutoCAD Drawing Management & Output
    Replies: 7
    Last Post: 12th Oct 2009, 05:55 pm
  2. Attribute edit-Rotate/Move Globally
    By ORgrown in forum AutoLISP, Visual LISP & DCL
    Replies: 25
    Last Post: 3rd Jun 2009, 08:01 pm
  3. Change Object Color
    By fade2blackened in forum AutoLISP, Visual LISP & DCL
    Replies: 9
    Last Post: 18th Jan 2009, 02:09 pm
  4. change color of layers
    By Tiger in forum AutoLISP, Visual LISP & DCL
    Replies: 14
    Last Post: 23rd Nov 2007, 06:26 pm
  5. can't change color of objects
    By moose321 in forum AutoCAD Drawing Management & Output
    Replies: 3
    Last Post: 24th Oct 2007, 04:31 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts