Efeezy Posted June 28, 2016 Share Posted June 28, 2016 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? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 28, 2016 Share Posted June 28, 2016 Is there a lisp to change my background color? Is there a fast way to change all the layers colors using a lisp? Which is it? Quote Link to comment Share on other sites More sharing options...
Efeezy Posted June 28, 2016 Author Share Posted June 28, 2016 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 Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 28, 2016 Share Posted June 28, 2016 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? Quote Link to comment Share on other sites More sharing options...
Efeezy Posted June 28, 2016 Author Share Posted June 28, 2016 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? Quote Link to comment Share on other sites More sharing options...
pkenewell Posted June 28, 2016 Share Posted June 28, 2016 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? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 28, 2016 Share Posted June 28, 2016 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'? Quote Link to comment Share on other sites More sharing options...
Efeezy Posted June 28, 2016 Author Share Posted June 28, 2016 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. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 29, 2016 Share Posted June 29, 2016 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) Quote Link to comment Share on other sites More sharing options...
Efeezy Posted June 29, 2016 Author Share Posted June 29, 2016 Thank you very much Lee Mac!!! I am very excited to try this out. Made my day!:lol: Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 29, 2016 Share Posted June 29, 2016 You're welcome - hope all goes well. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.