Thank You for your response and the resources.
I guess I am looking for How to access the entities of lines.
This is how, I am building the square block of lines.
{
Point3d[] pts = {
new Point3d( givenRefPoint.X, givenRefPoint.Y, givenRefPoint.Z),
new Point3d( givenRefPoint.X, givenRefPoint.Y + givenLeftHeight, givenRefPoint.Z),
new Point3d( givenRefPoint.X + givenWidthTop , givenRefPoint.Y + givenRightHeight, givenRefPoint.Z),
new Point3d(givenRefPoint.X + givenWidthBase , givenRefPoint.Y + givenRightHeight, givenRefPoint.Z),
new Point3d(givenRefPoint.X+ givenWidthBase,givenRefPoint.Y, givenRefPoint.Z)
};
int max = pts.GetUpperBound(0);
for (int i = 0; i <= max; i++)
{
int j = (i == max ? 0 : i + 1);
Line ln = new Line(pts[i], pts[j]);
ln.Thickness = panelThickness;
ln.Layer = Constants.LAYER_PANBLK; // I understand, I can change to one constant color.
ents.Add(ln);
}
}
I am looking for a way or resource, on how to access those line entities from the drawing?
Currently, I am accessing it from the BlockTableRecord, but it's changing the color for all the block references.
This is what I am currently using:
using (Transaction acTrans = dwgDb.TransactionManager.StartTransaction())
{
// Access drawing block table
pBlockTbl = acTrans.GetObject(dwgDb.BlockTableId, OpenMode.ForWrite) as BlockTable;
// ------------------
// ------------------
foreach (ObjectId btrId in pBlockTbl)
{
BlockTableRecord btr = (BlockTableRecord)acTrans.GetObject(btrId, OpenMode.ForRead);
if (!btr.IsLayout)
{
foreach (ObjectId id in btr)
{
Entity ent = (Entity)acTrans.GetObject(thePANBLKBlockReference, OpenMode.ForWrite);
ent.Layer = Constants.LAYER_FINGRD;
}
}
}
}
Thank You for your help in advance.