Quantcast
Channel: Autodesk AutoCAD forums
Viewing all articles
Browse latest Browse all 14319

Fill a table inside specified rectangle

$
0
0

Let's say I have a rectangle and I want to fill a table inside of it.

The below is the code snippet I wrote.....

 

Table tb = new Table();
tb.NumColumns = 5;
tb.NumRows = 40;
tb.SetRowHeight(C_height / 40);
tb.SetColumnWidth(C_width / 5);
tb.Position = new Point3d(ext.MaxPoint.X, total_MaxPoint.Y, 0);
tb.Width = C_width;
tb.Height = C_height;
tb.SetTextHeight(C_height / 40, (int)RowType.DataRow);
tb.HorizontalCellMargin = 0;
tb.VerticalCellMargin = 0;

btr.AppendEntity(tb);
tr.AddNewlyCreatedDBObject(tb, true);

 

Where C_width and C_height are the width and height of the rectangle respectively.

Then, I got the following

 

table.PNG

 

The red line is the specified rectangle. It seems like SetRowHeight and SetColumnWidth are not working.

FYI, the rectangle size is around width = 3.5m height = 5m.

 

Am I doing something wrong???

 

Thank you in advance.


Viewing all articles
Browse latest Browse all 14319

Trending Articles