How can I change a layers color using a script?

How can I change a layers color using a script?

Anonymous
Not applicable
5,430 Views
8 Replies
Message 1 of 9

How can I change a layers color using a script?

Anonymous
Not applicable

I can freeze and thaw layers, but how can I assign a new color to a layer?

 

when I select color this

 

it asked for Truecolor or COlbook....

 

so I don't know where to go from here

0 Likes
Accepted solutions (3)
5,431 Views
8 Replies
Replies (8)
Message 2 of 9

hmsilva
Mentor
Mentor
Accepted solution

@Anonymous wrote:

I can freeze and thaw layers, but how can I assign a new color to a layer?

 

when I select color this

 

it asked for Truecolor or COlbook....

 

so I don't know where to go from here


Current layer:  "0"
Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile]: c

New color [Truecolor/COlorbook] : <<<from 1 to 255>>>

 

Hope this helps,
Henrique

EESignature

Message 3 of 9

Anonymous
Not applicable

thank you

0 Likes
Message 4 of 9

hmsilva
Mentor
Mentor

@Anonymous wrote:

thank you


You're welcome, jthornton23MF3
Glad I could help

Henrique

EESignature

0 Likes
Message 5 of 9

Anonymous
Not applicable

can you using scripts on specific viewports?  both indidvidually and batch

0 Likes
Message 6 of 9

hmsilva
Mentor
Mentor

@Anonymous wrote:

can you using scripts on specific viewports?  both indidvidually and batch


Script, a *.scr file?

VPLAYER command?

If there is only one Viewpor in a specific Layout, yes.

 

Henrique

EESignature

0 Likes
Message 7 of 9

Anonymous
Not applicable

I got the script to work by making the layer, which I want to change it color to the current color, see below....

 

-layer
SET
A-WALL-PATT-G
C
13

 

SET
0

 

QSAVE
;end of script

 

Do I have to make the layer current before changing its color?

 

If I have multiple xrefs all containing the the layer "A-WALL-PATT", how can I select all of them and change their color?

0 Likes
Message 8 of 9

hmsilva
Mentor
Mentor
Accepted solution

Try

-layer
C
13
A-WALL-PATT-G,*|*A-WALL-PATT*

QSAVE
;end of script

 

Hope this helps,
Henrique

EESignature

Message 9 of 9

Kent1Cooper
Consultant
Consultant
Accepted solution

@Anonymous wrote:

I got the script to work by making the layer, which I want to change it color to the current color, see below....

 

-layer
SET
A-WALL-PATT-G
C
13

 

SET
0

 

QSAVE
;end of script

 

Do I have to make the layer current before changing its color?

....


No.  You can just give the Layer name inside the color option, and whatever the current Layer is will be irrelevant.  If the setting of Layer 0 current afterwards is only because that's what you expect to be the current Layer when you do this, and you want to leave it that way, you can then omit that resetting:

-layer
C
13

A-WALL-PATT-G

 

QSAVE

Kent Cooper, AIA
0 Likes