I'm trying to scale a table generated by my AutoCAD plugin. However the following code
public void formatCells()
{
Transaction tr = doc.TransactionManager.StartTransaction();
DocumentLock docLock = doc.LockDocument();
using (tr)
using (docLock)
{
if (!IsWriteEnabled || !IsReadEnabled) //Committing transactions closes everything for reading and writing so it must be reopened
{
tr.GetObject(this.ObjectId, OpenMode.ForRead);
tr.GetObject(this.ObjectId, OpenMode.ForWrite);
}
TransformBy(Matrix3d.Scaling(20, Position));
SetTextHeight(20, 7);
SetAlignment(CellAlignment.MiddleCenter, 1); //Sets alignment to middle center
SetRowHeight(3); //Sets height of new row
SetColumnWidth(8); //Sets width of new columns
tr.Commit();
}
}
Produces the result shown in the image below. How do I make the table look better instead of the mess it currently is?