.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Set IsByLayer color and assign it to an Entity

1 REPLY 1
SOLVED
Reply
Message 1 of 2
cgcamilo
574 Views, 1 Reply

How to Set IsByLayer color and assign it to an Entity

Hello,

 

I am using the RealDWG2015 sdk. I am using it to export into dwg my own representation.

 

Basically I create the layer first and I assign a color like this:

 

LayerTable layerTable = (LayerTable)tr.GetObject(db.LayerTableId, OpenMode.ForWrite);
LayerTableRecord record = new LayerTableRecord();
record.Name = "my layer"
record.Color = Autodesk.AutoCAD.Colors.Color.FromColorIndex(ColorMethod.ByAci, 0); //I want it black

 

Then, If I create an entity i dont see a method to create a color and set the "IsByLayer" property to TRUE.

 

Basically I want the color of the entity set to IsByLayer so, please correct me if I am wrong, it will have the opposite color of the layer backgroun (white).

 

What would be the best approach?

 

Thank you

Camilo Cifuentes
1 REPLY 1
Message 2 of 2
jabowabo
in reply to: cgcamilo

Try:
dbEnt.Color = Color.FromColorIndex(ColorMethod.ByLayer, 256);

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost