Problems with the AutoCAD Table

Problems with the AutoCAD Table

Matti72
Advocate Advocate
1,194 Views
5 Replies
Message 1 of 6

Problems with the AutoCAD Table

Matti72
Advocate
Advocate
  • I created a Table using a Tablestyle with a color “ColorMethod = ByAci, ColorIndex = 1” (red). In my Preview Control (via AcGsView) the Table lost its color, while it works correctly in the drawing. (Drawing with the Tablestyle is attached). Is this a bug or do I have to do something to get this working?
  • How do I create and access cell styles beside the normal Data/Title/Header. Some Methods allow to specify a string as CellStyle (e.G. TextHeight()) while others only accept the RowType enum (e.G. TableStyle.BackgroundColor()). So how do I set and get the Alignment(), Backgroundcolor(), Color(), etc of custom CellStyles?
0 Likes
1,195 Views
5 Replies
Replies (5)
Message 2 of 6

Balaji_Ram
Alumni
Alumni

Hi,

 

I do not reproduce the first behavior using the BlockView .Net sample.

The table appears with the assigned color as seen in the attached screenshot.

 

Can you please try it with the BlockView sample ?

http://adndevblog.typepad.com/autocad/2014/04/graphic-changes-in-autocad-2015.html

 

For creating custom cell styles, please try using the COM API.

You can find a VBA sample in the documentation (acadauto.chm) under "TableStyle object" topic. 

 

Regards,

Balaji



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 6

Matti72
Advocate
Advocate

Hi,

 

thank you for your answer.

 

Is there really no way to access the custom table style with ObjectARX or .net? Do I really have to use the .com api?

 

The other problem was with the fill color, as provided in the table style in the attached drawing. The border color works fine.

0 Likes
Message 4 of 6

SENL1362
Advisor
Advisor
I'am not sure what you want. i set Table Row styles like this
table.Rows[0].Style = "Title";
table.Rows[0].Height = TitleTextHeight + twiceTextMargin;
table.Rows[1].Style = "Header";
table.Rows[1].Height = HdrTextHeight + twiceTextMargin;

...
rowNr++;
table.Rows[rowNr].Style = "Data";
Cell data1Cell = InitTableCell(table.Cells[rowNr, 0]);
data1Cell.Contents[0].TextHeight = DataTextHeight;
data1Cell.Contents[0].TextString = kvp.Key;
data1Cell.Alignment = CellAlignment.TopRight;

...
public Cell InitTableCell(Cell cell)
{
cell.BackgroundColor = TabelBackgroundColor;
cell.Contents.Add();
cell.Borders.Left.Margin = TextMargin;
cell.Borders.Right.Margin = TextMargin;
cell.Borders.Top.Margin = TextMargin;
cell.Borders.Bottom.Margin = TextMargin;

return cell;
}
0 Likes
Message 5 of 6

Balaji_Ram
Alumni
Alumni

As Anton mentioned, it is possible to customize the cell style.

 

I had interpreted your query as creating a new cell style other than the Data, Header and Title already available.

Just the way AutoCAD UI lets you create a new cell style (attached screenshot)

 

In that case, i do not find a non-COM way to do it.

 

About the table fill color - 

 

Yes, i could reproduce the behavior in AutoCAD 2015 without any code. So, i have reported this behavior to our engineering team.

In "2d Wireframe", the fill color appears ok without masking the table text.

 

Can you please confirm if this behavior is the same as the one that you having with GsView in your project ?

 

1. Start AutoCAD 2015
 
2. Open the attached drawing. In this drawing, the table style has been modified to include a fill color.
 
3. Change Visual style to "Realistic" and click on the table and out.
 
The fill color masks the table text. Switching to "2d Wireframe" Visual style makes the table text reappear.
 

 

Regards,

Balaji

 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 6 of 6

Matti72
Advocate
Advocate

Thanks again for the answers.

 

I had interpreted your query as creating a new cell style other than the Data, Header and Title already available.

 

That's exactly, what we want to do. So com seems to be the way.

 

The fill color behavior you describe is the problem we have. Thanks for the reporting to engineering. 

0 Likes