Script for changing layers to specific colors not working with true colours

Script for changing layers to specific colors not working with true colours

ecje29
Participant Participant
1,071 Views
3 Replies
Message 1 of 4

Script for changing layers to specific colors not working with true colours

ecje29
Participant
Participant

I am trying to write a script that changes layers within a dwg to specific colors.

Here is an example of the code:

Layer

T *

ON *

UN *

S 0

M BUILDING

M LIFT

C 47 BUILDING

C 255,140,26 LIFT

S 0

 

The script works for all layers allocated an index color but fails to work for layers with a true or color book shade.

When I load the script the following message is displayed and I don’t know how to proceed.

 

Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]: C

New color [Truecolor/COlorbook] : 255,140,26

A color number or standard color name is required.

 

It works when I type in New color [Truecolor/COlorbook] : T Red,Green,Blue: 255,140,26  but this is time consuming if I have to do this for all Truecolor/COlorbook layers each time.

 

Please note I am not experienced in Autolisp so any help would be greatly appreciated.

 

Thanks in advance.

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

dlanorh
Advisor
Advisor
Accepted solution

Look Here 

I am not one of the robots you're looking for

Message 3 of 4

marko_ribar
Advisor
Advisor
Accepted solution

Probably...

Change this in script :

C 255,140,26 LIFT

To this :

C T 255,140,26 LIFT

Marko Ribar, d.i.a. (graduated engineer of architecture)
Message 4 of 4

ecje29
Participant
Participant

Thank you so much, this worked perfectly!

0 Likes