Jump to content

Lisp to change colour from Bylayer to actual colour


woodman78

Recommended Posts

Does anyone have a lisp that when an entity is selected it will take the bylayer colour and assign that colour directly to the entity without it being bylayer?

Link to comment
Share on other sites

Quickly written:

 

(defun c:test ( / a b c d e f )
 (while (setq a (tblnext "LAYER" (null a)))
   (setq b (cons (cons (cdr (assoc 2 a)) (abs (cdr (assoc 62 a)))) b))
 )
 (if (setq c (ssget "_:L"))
   (repeat (setq d (sslength c))
     (setq e (entget (ssname c (setq d (1- d))))
           f (cons 62 (cdr (assoc (cdr (assoc 8 e)) b)))
     )
     (entmod (if (assoc 62 e) (subst f (assoc 62 e) e) (append e (list f))))
   )
 )
 (princ)
)

Link to comment
Share on other sites

hi Lee.

Can you develop your lisp more? Ex: when click object, display number color on box without change bylayer.

Thank you so much.

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