Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

table cell background fill color issue

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
2911 Views, 4 Replies

table cell background fill color issue

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

 

 

4 REPLIES 4
Message 2 of 5
Balaji_Ram
in reply to: Anonymous

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

Message 3 of 5
Anonymous
in reply to: Balaji_Ram

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

Message 4 of 5
Balaji_Ram
in reply to: Anonymous

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

Message 5 of 5
Anonymous
in reply to: Balaji_Ram

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.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report