Hoping somebody can help me out. I have a table in AutoCAD that has been created thru cutting and pasting as ACAD objects from excel.
My end goal is to strip all the formatting but retain the background fill color.
I know there is a fill color because of the "\\c0" in the contents of the cell, but that doesn't tell me what color it is
.
I am using the StripTableFormatting() code from Through-the-interface as a base point because it does what I want, but I just want to capture the color on the cell and then restore it after everything has been stripped.
The contents of the cell is "{\\fArial|b1|i0|c0;\\c0;2.0000"
this is what I have tried
var cell = tab.Cells[r, c];
coloridx = cell.BackgroundColor.ColorIndex;
but this does not give me the color and I don't know how to retrieve it?
Any help would be really appreciated.
cj
Solved! Go to Solution.
Solved by Balaji_Ram. Go to Solution.
Hi CJ,
Have you tried looking at the "ColorMethod" from BackgroundColor that you have retrieved ?
If its not storing the color index, then ColorIndex may not give you the value.
It could be storing as R, G, B values for example.
Regards,
Balaji
Thanks for responding Balayi,
Yes I have tried.......ColorMethod = None, R,G,B are all 0.
I have attached the drawing file for you to take a look at. It was created by cutting and Pasting as AutoCAD objects from Excel.
thanks for any further assistance you can provide.
Coralie
Hi CJ,
Can you please check the BackgroundColor.ColorValue ?
That seems to be holding the R,G,B values in the sample drawing that you shared.
Regards,
Balaji
Thanks for the help Balaji,
I finally got it figured out. I had an error in my logic.
cj
Can't find what you're looking for? Ask the community or share your knowledge.