Need a help regarding managing rows and column in table.

Need a help regarding managing rows and column in table.

Anonymous
Not applicable
346 Views
1 Reply
Message 1 of 2

Need a help regarding managing rows and column in table.

Anonymous
Not applicable

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");
}TableTable

0 Likes
347 Views
1 Reply
Reply (1)
Message 2 of 2

omartin
Advocate
Advocate

even though you don't want any column titles, add some text instead of null. at the end where you turn off show title will take care of it.

Also if that does not solve it. try to specify the size of the of the row and column arrays ([1], [0] respectively)

 

Was my reply Helpful ? send a Kudos or accept as solution
0 Likes