color bylayer

color bylayer

Anonymous
Not applicable
2,876 Views
4 Replies
Message 1 of 5

color bylayer

Anonymous
Not applicable
Hello,

I think I have a very simple problem but i am already trying the whole evening to solve it. I try to change the color of a line to byLayer I tryed the next options:

//lijn1 is an LineObject

lijn1.ColorIndex = 0;
//but then the linecolor is byblock.

I tried
lijn1.Color = Color.FromColorIndex(ColorMethod.ByLayer, 0)
//but then te linecolor is byblock.

How to change the line color to bylayer??

thanks
0 Likes
2,877 Views
4 Replies
Replies (4)
Message 2 of 5

Mikko
Advocate
Advocate
Maybe? Message was edited by: Mikko
0 Likes
Message 3 of 5

Mikko
Advocate
Advocate
change 0 to 256?
0 Likes
Message 4 of 5

Anonymous
Not applicable
ColorIndex = 256;

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5762769@discussion.autodesk.com...
Hello,

I think I have a very simple problem but i am already trying the whole evening to solve it. I try to change the color of a line to byLayer I tryed the next options:

//lijn1 is an LineObject

lijn1.ColorIndex = 0;
//but then the linecolor is byblock.

I tried
lijn1.Color = Color.FromColorIndex(ColorMethod.ByLayer, 0)
//but then te linecolor is byblock.

How to change the line color to bylayer??

thanks
0 Likes
Message 5 of 5

Anonymous
Not applicable
Yes off course, I thought that 256 was outside the byte-range(0-255),
Ok thanks this works fine.
0 Likes