Change select colors to a different color with lisp

Change select colors to a different color with lisp

Anonymous
Not applicable
1,790 Views
3 Replies
Message 1 of 4

Change select colors to a different color with lisp

Anonymous
Not applicable

I have changed 19 colors in my .ctb and reassigned them to different numbers.

 

I am wanting a lisp (or a faster way than described below) that will change these 19 colors to 19 different colors, regardless of what type of object they are, if they are in a block or not and that will also change them regardless of what paper/model space tab they are on.

 

It is basically something like QSELECT but I do not want to have to use QSELECT 19 times on each paper space tab and in each model space tab.

This is for 50+ templates with some having upwards of 20 sheets, and not every color is used in every template or every tab.

 

So to be specific, I would like color 10 to change to color 201, every time, no matter where it is found in the drawing.

I would also need these colors to be changed in a specific order as several of the colors that are getting changed are actually being reused.

For example, color 201(blue) is changing to color 226(blue) first, then color 10(red) is changing to color 201(now red/formerly blue).

 

If someone could set up the lisp to search for and change those 2 colors listed above, and copy paste that bit of code 18 times, I can edit the other 18 to the colors I need. (I can also post the colors and their changed values if necessary, I am just saving space on this already long post if it can't be done)

I can edit lisps to change values fairly well but can't write new lisps to save my life.

 

Any help or advice would be appreciated.

0 Likes
Accepted solutions (1)
1,791 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

ummmm.....  

  1. why are you doing this??
  2. Are you not drawing with color BYLAYER??  If you leave objects color BYLAYER then you only need to change the color in the layer settings once, not for each layout.
  3. Yes it could be done, but needs ALL the details, you'd have better luck posting this question here.
0 Likes
Message 3 of 4

Anonymous
Not applicable

Our company has a set layer list of 20 layers that do just what you are describing.

We do not need more than 20 layers in our industry and creating a new layer each time a client wants some random thing in color would be excessive and counterproductive.

However, this .ctb of ours is driven by clients and if they want something to print in color, we can't have everything on that layer change to print in color and we can't just add a new layer because they will reject our CAD files that we submit to them. We HAVE to stick to this layer list.

Due to the way my company does business and who we work with, we had to move our colors due to clients requiring us to use certain colors on certain layers a certain way and those numbers were already in use. I agree this is ridiculous but I don't get make those decisions.

I am looking into posting this in the link you sent.

0 Likes
Message 4 of 4

Anonymous
Not applicable
Accepted solution

Each client should have its own CTB and own layer set controlled by templates/customization that is determined PRIOR to starting drawings.  Trying to monkey with it after the fact is asking for rejections, especially if users are changing the colors of objects from BYLAYER.  They may not use 205, but use 215 instead, then your custom routine will miss it.

 

We have over 15 different clients, each with its own layer/color standard, each has a corresponding CTB/STB and each has its own templates and layer control LISP, and EVERYTHING remains BYLAYER with the sole exception being text in dimensions (controlled in templates).

 

Good luck getting some help at the lisp group.  You can also try www.theswamp.org, the guys there are magicians.