table cell background fill color issue

table cell background fill color issue

Anonymous
Not applicable
3,376 Views
4 Replies
Message 1 of 5

table cell background fill color issue

Anonymous
Not applicable

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

 

 

0 Likes
Accepted solutions (1)
3,377 Views
4 Replies
Replies (4)
Message 2 of 5

Balaji_Ram
Alumni
Alumni

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



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 5

Anonymous
Not applicable

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

0 Likes
Message 4 of 5

Balaji_Ram
Alumni
Alumni
Accepted solution

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

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 5

Anonymous
Not applicable

Thanks for the help Balaji,

 

I finally got it figured out. I had an error in my logic.

 

cj

0 Likes