Results 1 to 2 of 2

Thread: Change to gray

  1. #1
    Member
    Join Date
    2015-12
    Location
    Las Vegas, NV
    Posts
    20
    Login to Give a bone
    0

    Default Change to gray

    I would like for programmer to change the color inside a block, inside a block. It will change the object that the user pick to the color that i set. I just can't get it to work inside a block. I know all the varaible (cmdecho....) are not in yet.

    Please HELP Corn

    Explode is not an option....

    Code:
    (defun changetoexisting ( / )
      (setq ss_nam 0)
      (setq ss_clr 8)
      (setq sset (ssget))
      (setq ss_len (sslength sset))
      (repeat ss_len
        (setq ss_ent (ssname sset ss_nam))
        (setq ss_end (entget ss_ent))
        (if (assoc 62 ss_end)
          (setq ss_end (subst (cons 62 ss_clr)(assoc 62 ss_end) ss_end))
          (setq ss_end (append ss_end (list (cons 62 ss_clr))))
          );end of if
        (entmod ss_end)
        (if (= "INSERT" (cdr (assoc 0 ss_end)))
          (progn
    	(setq ssbk_nam (cdr (assoc 2 ss_end)))
    	(setq ssbk_ent (cdr (assoc -2 (tblsearch "BLOCK" ssbk_nam))))
    	(setq ssbk_end (entget ssbk_ent))
    	(if (assoc 62 ssbk_end)
    	  (setq ssbk_end (subst (cons 62 ss_clr)(assoc 62 ssbk_end) ssbk_end))
    	  (setq ssbk_end (append ssbk_end (list (cons 62 ss_clr))))
    	  );end of if
    	(entmod ssbk_end)
    	(setq sstx_end (entget ssbk_ent))
    	(while ssnx_ent
    	  (setq ssnx_ent (entnext (cdr (assoc -1 sstx_end))))
    	  (setq ssnx_end (entget ssnx_ent))
    	  (if (assoc 62 ssnx_end)
    	    (setq ssnx_end (subst (cons 62 ss_clr)(assoc 62 ssnx_end) ssnx_end))
    	    (setq ssnx_end (append ssnx_end (list (cons 62 ss_clr))))
    	    );if
    	  (entmod ssnx_end)
    	  );while
    	(setq ss_all_blocks (ssget "x" (list (cons 2 ssbk_nam))))
    	(setq bk_count 0)
    ;;;	(while
    ;;;	  (setq blk_ent (ssname ss_all_blocks blk_count))
    ;;;	  (setq blk_count (+ 1 blk_count))
    ;;;	  (entupd blk_ent)
    ;;;	  );while
    	);end of progn
          );end of if
        (setq ss_nam (+ ss_nam 1))
        );end of repeat
      (princ)
      );---< end of defun >---
    
    (defun c:ccc (/)
      (changetoexisting)
      (princ)
      )
    Last edited by Opie; 2008-12-10 at 03:56 AM. Reason: [code] tags added, which disable smilies

  2. #2
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Change to gray

    The problem is your while statement is never true. You never set the variable ' ssnx_ent ' before you start the while, so it will always get skipped.

    Also, you should make your variables local.

Similar Threads

  1. gray edges
    By MikeJarosz in forum Revit Architecture - General
    Replies: 1
    Last Post: 2011-01-18, 08:03 PM
  2. 3D solids all plot in Gray
    By lholt in forum AutoCAD Map 3D - General
    Replies: 1
    Last Post: 2008-11-11, 02:44 PM
  3. Gray Walls
    By Brian Myers in forum Revit MEP - General
    Replies: 16
    Last Post: 2007-12-05, 02:09 AM
  4. Level Markers are Gray how to change to black?
    By chris.135357 in forum Revit Structure - General
    Replies: 5
    Last Post: 2007-03-07, 07:51 PM
  5. Change Layer colors to Plot gray on a few Layouts
    By andrewp in forum AutoCAD General
    Replies: 5
    Last Post: 2006-12-12, 11:05 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
  •