muntafuner Posted October 22, 2019 Share Posted October 22, 2019 Hello from Austria, i have a problem and couldn´t find any answers to this particular problem: I would like to change the layers of multiple hatches in the drawing according to the specific colors. For example: All hatches ar located on the Layer "Poly_Muster", now i would like to select all hatches with the color 153,76,0 and then they should be changed to the layer "Poly_Mauerwerk", all hatches with the color 128,210,4 to "Poly_Stahlbeton" and so on.. is there a solution i can do this with a script or a lisp? Thank you in advance! Kind regards, Simon Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 22, 2019 Share Posted October 22, 2019 Credit 1s t to lee-mac ;; True -> RGB - Lee Mac ;; Args: c - [int] True Colour (defun LM:True->RGB ( c ) (mapcar '(lambda ( x ) (lsh (lsh (fix c) x) -24)) '(8 16 24)) ) If you look at this (setq Col (cdr (assoc 420 (entget (car (entsel)))))) pick the hatch returns the color number eg 3899588 then (LM:True->RGB col) will convert to a list of RGB Command: (LM:TRUE->RGB col) (59 128 196) Sou can do a Cond or if then = list variable Quote Link to comment Share on other sites More sharing options...
muntafuner Posted October 23, 2019 Author Share Posted October 23, 2019 Thanks for your quick response. I´m sorry but i´m really a beginner with this coding thing.. how do i now add the hatches? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 24, 2019 Share Posted October 24, 2019 (edited) You post a sample dwg with hatches and a explanation of what color goes on what layer. Only need a few. Edited October 24, 2019 by BIGAL Quote Link to comment Share on other sites More sharing options...
muntafuner Posted October 28, 2019 Author Share Posted October 28, 2019 Thank you for your response! You find a sample-file in the attachment. As you can see, the hatch with the color "128,210,4" lays on the Layer "Poly_Muster" but it should be on the Layer "Poly_Stahlbeton"; the hatch with the color "153,76,0" lays also on the layer "Poly_Muster" but it should be on the layer "Poly_Mauerwerk"... for example. Thank you in advance for your help an response! Kind regards, Simon Test01.dwg 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.