Results 1 to 7 of 7

Thread: LISP for change yellow color into Color 8

  1. #1
    Member
    Join Date
    2013-10
    Posts
    2
    Login to Give a bone
    0

    Default LISP for change yellow color into Color 8

    Hy,

    is there lips that change all YELLOW color into Color 8?

    First = it will be good to change all drawings colored yellow to be changed BY LAYER (all line, polyline, object colored yellow to change color by layer)
    second = then all layers colored yellow change to Color 8

    Thanks,
    Robert

  2. #2
    All AUGI, all the time
    Join Date
    2010-10
    Posts
    535
    Login to Give a bone
    0

    Default Re: LISP for change yellow color into Color 8

    Quote Originally Posted by rhodinj1427782 View Post
    Hy,
    is there lips that change all YELLOW color into Color 8?
    The most obvious response would be QSELECT + Properties Dialog

    Quote Originally Posted by rhodinj1427782 View Post

    First = it will be good to change all drawings colored yellow to be changed BY LAYER (all line, polyline, object colored yellow to change color by layer)

    command: Setbylayer

    Quote Originally Posted by rhodinj1427782 View Post
    second = then all layers colored yellow change to Color 8
    Layer dialog.

    Do you really really need a lisp code for this rhodinj?

    Code:
    (defun c:ctg ( / color ss i e l a cur data)	;<-- Color To Gray
      (while
        (progn
          (initget 7)
          (setq color (getint "\nEnter Color to process [2/50/51]: "))
          (if (not (member color '(2 50 51)))
    	(princ "\nInvalid Value")
          )
        )
      )
      (if (setq ss (ssget "_X" (list (cons 62 color))))
          	(repeat (setq i (sslength ss))
    	  	(setq e (entget (ssname ss (setq i (1- i))))
                      	      l (assoc -1 e))
                      	 (entmod (list'(62 . 256) l))
    		)
        )
          (while (setq a (tblnext "LAYER" (null a)))
    	(if
    	  (= color
    	     (abs (cdr (setq	cur 
    			      (assoc 62
    				     (setq data
    					(entget
    					  (tblobjname "LAYER" (cdr (assoc 2 a)))
    					)
    				     )
    			      )
    			    )
    		  )
    	     )
    	  )
    	   (entmod (subst (cons 62
    				(if (minusp (cdr cur)) (- 8) 8))
    				cur data))
    	)
          )
      (princ)
    )
    HTH
    Last edited by pbejse; 2014-01-16 at 04:04 AM.

  3. #3
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: LISP for change yellow color into Color 8

    If any of the yellow colored layers is off , then the dxf value would be minus

  4. #4
    Member
    Join Date
    2013-10
    Posts
    2
    Login to Give a bone
    0

    Default Re: LISP for change yellow color into Color 8

    it can be very usful lisp, when we type lisp for yellow color (color 2, 50, 51 in same lisp), lisp automatically change our colors in grey.
    That will be awsome!

  5. #5
    All AUGI, all the time
    Join Date
    2010-10
    Posts
    535
    Login to Give a bone
    0

    Default Re: LISP for change yellow color into Color 8

    Quote Originally Posted by Tharwat View Post
    If any of the yellow colored layers is off , then the dxf value would be minus
    Good point Tharwat ... [Next you would say.. locked layers. You already know my stand on that issue ]

    Quote Originally Posted by rhodinj1427782 View Post
    it can be very usful lisp, when we type lisp for yellow color (color 2, 50, 51 in same lisp), lisp automatically change our colors in grey.
    That will be awsome!
    Still maintaining the same approach as before: [Updated code at post #2]

    HTH

  6. #6
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: LISP for change yellow color into Color 8

    Quote Originally Posted by pbejse View Post
    [Next you would say.. locked layers. ]
    I promise , there won't be any more .

  7. #7
    All AUGI, all the time
    Join Date
    2010-10
    Posts
    535
    Login to Give a bone
    0

    Default Re: LISP for change yellow color into Color 8

    Quote Originally Posted by Tharwat View Post
    I promise , there won't be any more .
    It's alright tharwat. I appreciate you looking at the codes, helps the OP as well as me to debug the code.

    Keep on doing what you're doing my friend

    Cheers

Similar Threads

  1. Replies: 4
    Last Post: 2015-02-16, 07:53 PM
  2. Layer Color Change LISP Routine
    By guardianfiredesign774457 in forum AutoLISP
    Replies: 19
    Last Post: 2013-08-28, 05:08 AM
  3. Attribute color change through LISP
    By bradley.palmer407325 in forum AutoCAD Customization
    Replies: 1
    Last Post: 2012-09-27, 11:32 AM
  4. Help with this color change LISP routine
    By jeff.richards in forum AutoLISP
    Replies: 4
    Last Post: 2008-11-26, 02:54 PM
  5. Lisp to change layer color in viewport
    By moonlight_9630 in forum AutoLISP
    Replies: 2
    Last Post: 2008-07-08, 07:31 PM

Tags for this Thread

Posting Permissions

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