Need a help regarding managing rows and column in table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All,
I hope you all are doing well . I need 1 help from you that is I am facing a problem while making the table without title block. Please go through .I am attaching code and pic also .Please let me know if there is any changes.
Thank You...
Here is a code---->
try
{
string path1 = @"C:\Gaurav\Application\files\26-8-2019\Global_Template_Model.dwg";
String sTemplateFile;
sTemplateFile = application.FileManager.GetTemplateFile(DocumentTypeEnum.kDrawingDocumentObject);
DrawingDocument oDrawDoc = (DrawingDocument)application.Documents.Open(path1);
Point2d oPoint1 = application.TransientGeometry.CreatePoint2d(5, 5);
Sheet oSheet = oDrawDoc.ActiveSheet;
string[] oTitles = null;
string[] oContents = new string[] { "Tightening torque (fixing bolts) :", "NA" };
string ColumnWidth = textBox1.Text;
double _columnWidth = Convert.ToDouble(ColumnWidth);
Double[] oColumnWidths = new Double[] { _columnWidth, _columnWidth };
string RowHeight = textBox2.Text;
Double _rowHeights = Convert.ToDouble(RowHeight);
Double[] oRowHeights = new Double[] { _rowHeights };
Point2d InsP = application.TransientGeometry.CreatePoint2d(20, 40);
int NumberOfRows = 2;
int NumberOfColumns = 1;
CustomTable oCustomTable = oSheet.CustomTables.Add("Table", InsP, NumberOfRows, NumberOfColumns, oTitles, oContents, oColumnWidths, oRowHeights);
TableFormat oFormat = oSheet.CustomTables.CreateTableFormat();
oCustomTable.Columns[1].ValueHorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextLeft;
// oCustomTable.Columns[2].ValueHorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextLeft;
// oCustomTable.Columns[3].ValueHorizontalJustification = HorizontalTextAlignmentEnum.kAlignTextLeft;
oFormat.InsideLineColor = application.TransientObjects.CreateColor(0, 0, 0);
oFormat.InsideLineWeight = 0.02;
oFormat.OutsideLineWeight = 0.1;
oCustomTable.OverrideFormat = oFormat;
oCustomTable.ShowTitle = false;
}
catch (Exception)
{
MessageBox.Show("Exception2");
}Table