Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Routine to change Attributes color to Bylayer not working in AutoCAD 2008

  1. #1
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Routine to change Attributes color to Bylayer not working in AutoCAD 2008

    This is one for changing attributes to color bylayer. I got it ether here or on Autodesk forums.
    1.
    Code:
    (if (ssget "x" '((0 . "INSERT")(66 . 1)))
        (progn
          (setq ss (vla-get-activeselectionset
    		 (vla-get-activedocument
    		   (vlax-get-acad-object))))
          (vlax-for blk ss
    	(setq atts (vlax-invoke blk 'getattributes))
    	(foreach att atts
    	  (vla-put-color att 256)
    	  )
    	)
          )
        )
    2nd

    Code:
    (setq doc     (vla-get-activeDocument (vlax-get-acad-object))
            layouts (vla-get-layouts doc)
      )
      (vlax-for layout layouts
        (vla-put-showPlotStyles layout (if state :vlax-true :vlax-false))
      )
      ;(vla-regen doc acAllViewports)
    Any help to make it work again would be greatly appreciated.
    Chris
    Last edited by framedNlv; 2007-05-04 at 11:31 PM.

  2. #2
    100 Club
    Join Date
    2006-11
    Location
    UTAH
    Posts
    135
    Login to Give a bone
    0

    Default Re: Routine to change Attributes color to Bylayer not working in AutoCAD 2008

    This is now done natively in 2008 with the Setbylayer command.

  3. #3
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Re: Routine to change Attributes color to Bylayer not working in AutoCAD 2008

    Quote Originally Posted by mike.127154
    This is now done natively in 2008 with the Setbylayer command.
    I read about that on one of the blogs somewhere but could find any reference to it once we install 2008.

    Thanks,
    Chris

  4. #4
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Routine to change Attributes color to Bylayer not working in AutoCAD 2008

    Quote Originally Posted by FRAMEDNLV
    I read about that on one of the blogs somewhere but could find any reference to it once we install 2008.

    Thanks,
    Chris
    From the Menu:
    Modify => Change to Bylayer

  5. #5
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: Routine to change Attributes color to Bylayer not working in AutoCAD 2008

    Quote Originally Posted by Tom Beauford
    From the Menu:
    Modify => Change to Bylayer
    or type setbylayer

  6. #6
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Re: Routine to change Attributes color to Bylayer not working in AutoCAD 2008

    Thank you guys for pointing out the "setbylayer" feature.

    I was wondering why the original lisp was failing. I have about three different lisp routines that are failing and they all use the vla/vlax in the lisp.


    Chris

  7. #7
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Routine to change Attributes color to Bylayer not working in AutoCAD 2008

    Quote Originally Posted by FRAMEDNLV
    Thank you guys for pointing out the "setbylayer" feature.

    I was wondering why the original lisp was failing. I have about three different lisp routines that are failing and they all use the vla/vlax in the lisp.


    Chris
    I'm sure someone could debug it if you posted the whole routine.

  8. #8
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: Routine to change Attributes color to Bylayer not working in AutoCAD 2008

    i would also make sure you have vl-load-com in your commands

  9. #9
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Re: Routine to change Attributes color to Bylayer not working in AutoCAD 2008

    Code:
    (VL-LOAD-COM)
    That seems to have fixed it. I'll have to look at my startup lisp to see where it was loading and where I stopped loading it. For now I just added it to the beginning of our acad.lsp.

    Thanks,
    Chris

  10. #10
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,102
    Login to Give a bone
    0

    Default Re: Routine to change Attributes color to Bylayer not working in AutoCAD 2008

    Quote Originally Posted by FRAMEDNLV
    Code:
    (VL-LOAD-COM)
    That seems to have fixed it. I'll have to look at my startup lisp to see where it was loading and where I stopped loading it. For now I just added it to the beginning of our acad.lsp.

    Thanks,
    Chris
    It is only needed to be loaded once. Subsequent calls do not affect anything.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

Page 1 of 2 12 LastLast

Similar Threads

  1. Changing attributes color bylayer...?
    By aport in forum AutoCAD LT - General
    Replies: 5
    Last Post: 2018-09-11, 02:18 PM
  2. Command to Change Color of Mtext to BYLAYER
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 8
    Last Post: 2010-01-22, 10:58 PM
  3. Change Attributes to color ByLayer
    By rmk in forum AutoCAD General
    Replies: 7
    Last Post: 2008-01-22, 12:24 AM
  4. How to change block w/ attributes bylayer
    By aport in forum AutoCAD General
    Replies: 6
    Last Post: 2008-01-16, 04:59 AM
  5. Replies: 2
    Last Post: 2007-02-12, 05:04 PM

Posting Permissions

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