Jump to content

Lisp to change all objects with a certain color to another color


mikeSIEMENS

Recommended Posts

We have drawings that were converted from solid edge, and don't print properly because the text has a color in this format 0,128,128 instead of the 128 format. Is there a way I can change all objects with the color 0,128,128 to a normal AutoCAD color that will be recognized by the pen style?

Link to comment
Share on other sites

Something like this?

 

(defun c:cChng (/ clr i ss ent elst)
 (vl-load-com)

 (if (and (setq clr     (acad_colordlg 0))
          (setq i -1 ss (ssget "_:L")))
   
   (while (setq ent (ssname ss (setq i (1+ i))))
     (setq elst
       (vl-remove-if
         (function
           (lambda (x)
             (vl-position (car x) '(62 420)))) (entget ent)))

     (entmod (append elst (list (cons 62 clr))))))

 (princ))
     

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