Jump to content

Changing Background colors


Efeezy

Recommended Posts

Is there a lisp to change my background color?

We receive projects from multiple architects so the names of the layers will be different every project. For our background standards we use multiple colors.

walls 242

existing walls 251

doors 87

glaze 137

ect......

Is there a fast way to change all the layers colors using a lisp?

Link to comment
Share on other sites

I need to change my layer colors to:

walls 242

existing walls 251

doors 87

glaze 137

ect......

 

I have a lot of other layer I need to change the color on also. So is there a way to make wall color 242 existing wall 251?

 

I already have a lisp that changes all the layer to 252. Great at my previous job. Not the company standards here. Thank you for your help :)

Link to comment
Share on other sites

I need to change my layer colors to:

walls 242

existing walls 251

doors 87

glaze 137

ect......

 

I have a lot of other layer I need to change the color on also. So is there a way to make wall color 242 existing wall 251?

 

Are those the layer names?

Link to comment
Share on other sites

That is the problem. The layer names will change a little since we will be working with different architecture firms. Is it even possible to do this?

Link to comment
Share on other sites

That is the problem. The layer names will change a little since we will be working with different architecture firms. Is it even possible to do this?

 

 

Have you tried using the LAYTRANS command?

Link to comment
Share on other sites

That is the problem. The layer names will change a little since we will be working with different architecture firms. Is it even possible to do this?

 

How would you propose that the program determines which colours are to be assigned to which layers?

 

Should the program attempt to detect partial layer names, such as layer names containing the phrase 'existing wall'?

Link to comment
Share on other sites

yes a partial layer name would be great if it is possible. That would be great. If you can get it going I can fill in the rest. Based on what you have started.

Link to comment
Share on other sites

Here's something to get you started:

(defun c:laycol ( / col lay lst )
   (setq lst
      '(
           ("*existing*wall*" . 251)
           ("*wall*"          . 242)
           ("*doors*"         . 087)
       )
   )
   (vlax-for obj (vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
       (if (setq lay (strcase (vla-get-name obj))
                 col (vl-some '(lambda ( x ) (if (wcmatch lay (strcase (car x))) (cdr x))) lst)
           )
           (vla-put-color obj col)
       )
   )
   (princ)
)
(vl-load-com) (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...