I have problem to change the color of the acadblock. But i can able to change the color for line and arc etc. But when i try to change the block color it does not change. Can any body tell me how to do?
Here i have mentioned my code:
AcadApplication acadApp;
AcadDocument curDoc;
AcadSelectionSet selset;
AcadLine lin;
AcadBlockReference blkRef;
short[] ftype = new short[1];
object[] fdata = new object[1];
ftype[0] = 0;
fdata[0] = "Line,INSERT";
acadApp = (AcadApplication)Marshal.GetActiveObject("Autocad.Application.18");
curDoc = acadApp.ActiveDocument;
selset = curDoc.SelectionSets.Add("Selset2");
selset.Select(AcSelect.acSelectionSetAll, null, null, ftype, fdata);
foreach (AcadEntity item in selset)
{
if (item.ObjectName == "AcDbLine")
{
item.color = ACAD_COLOR.acYellow; //here working fine
}
else if (item.ObjectName == "AcDbBlockReference")
{
item.color = ACAD_COLOR.acMagenta; //here does not working
}
}
selset.Delete();
Thanks in Advance..