TBC Macros and Extensions

Draw a custom table in TBC 

02-02-2021 18:35

I am trying  to draw a table in TBC with the information based on a data table and I don't want to simply draw the table using line and Mtext.

Are there any methods that I can use create a custom table? I came across the below methods but without any proper documentation it's really hard to work them out

-LableTableCell
-LabelTableColumnsBase
-LabelTabelColumns
-LableTableEntityBase
-LableTableRowBase
-LableTableRows

This was used to be an easy task in AutoCAD, goes like this

        public void addRow(String[] data)
        {
            // Use a nested loop to format each cell
            for (int i = 0; i < data.Length; i++)
            {
                ParseOption s = new ParseOption();
                Cells[rowCount, i].TextHeight = 1;
                Cells[rowCount, i].SetValue(data[i], s);
            }
            GenerateLayout();


            Transaction tr = doc.TransactionManager.StartTransaction();
            using (tr)
            {
                BlockTable bt = (BlockTable)tr.GetObject(doc.Database.BlockTableId, OpenMode.ForRead);
                BlockTableRecord btr = (BlockTableRecord)tr.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite);

                btr.AppendEntity(this);
                tr.AddNewlyCreatedDBObject(this, true);
                tr.Commit();
            }
        }

Statistics
0 Favorited
29 Views
0 Files
0 Shares
0 Downloads

Related Entries and Links

No Related Resource entered.