// table
TableEntity table = new TableEntity
{
InsertPoint = new XYZ(50, 50, 0),
HorizontalDirection = new XYZ(1, 0, 0)
};
table.Columns.Add(new TableEntity.Column { Width = 40 });
table.Columns.Add(new TableEntity.Column { Width = 40 });
table.Columns.Add(new TableEntity.Column { Width = 40 });
for (int i = 0; i < 3; i++)
{
var row = new TableEntity.Row { Height = 10 };
for (int j = 0; j < 3; j++)
{
var cell = new TableEntity.Cell();
var content = new TableEntity.CellContent();
content.ContentType = TableEntity.TableCellContentType.Value;
cell.Contents.Add(content);
row.Cells.Add(cell);
}
table.Rows.Add(row);
}
table.GetCell(0, 0).Content.CadValue.SetValue("Title 1", CadValueType.String);
table.GetCell(0, 1).Content.CadValue.SetValue("Title 2", CadValueType.String);
table.GetCell(1, 0).Content.CadValue.SetValue("Data 1", CadValueType.String);
layout.AssociatedBlock.Entities.Add(table);
but I can't see any table in the current layout.
Thanks in advance
Is table insertion supported?
I tried such code:
but I can't see any table in the current layout.
Thanks in advance