Solved! Go to Solution.
Solved by _gile. Go to Solution.
Hi I'm having a similar issue, trying to set the colour variables, using ColorIndex:
my code is as follows:
AcadAcCmColor col;
AcadAcCmColor col2;
AcadAcCmColor col3;
col.ColorIndex = 90;
col.ColorIndex = 253;
col.ColorIndex = 3;
PressTable.SetCellContentColor(LstRow, 0, col3);
Can anyone point me in the right direction?
sorry that was a typo
AcadAcCmColor col;
AcadAcCmColor col2;
AcadAcCmColor col3;
col.ColorIndex = 90;
col2.ColorIndex = 253;
col3.ColorIndex = 3;
PressTable.SetCellContentColor(LstRow, 0, col3);
the error is the color index not being set, the variables need to be a AcadAcCmColor to work in the SetCellContentColour method.
Regards,
You need to create new instances of AcadAcCmColor before assigning them a color. An then, use the AcColor enum for the color index value.
AcadAcCmColor col = new AcadAcCmColor(); col.ColorIndex = (AcColor)3; // or AcColor.acGreen; PressTable.SetCellContentColor(0, 0, col);
But if you can use the .NET API instead of the COM API, you can simply do:
table.Cells[0, 0].ContentColor = Color.FromColorIndex(ColorMethod.ByAci, 3);
Can't find what you're looking for? Ask the community or share your knowledge.