Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I'm using the following code to create a custom table. But the table isn't coming out exactly how I want it to. Is there a way to not show the Title block? Also, currently it list them from the bottom-up. I would like them to be listed from the top-down. Is there a way to change the direction of the table using iLogic?
Sub Table1() Dim oDwgDoc As DrawingDocument = ThisApplication.ActiveDocument Dim oSheet As Sheet = oDwgDoc.Sheets.Item(1) ' the column titles Dim oTitles(1) As String oTitles(0) = "" oTitles(1) = "" ' the contents Of the custom table (contents are row-wise) Dim oContents(41) As String oContents(0) = "" oContents(2) = "" oContents(4) = "" oContents(6) = "" oContents(8) = "" oContents(10) = "" oContents(12) = "" oContents(14) = "" oContents(16) = "" oContents(18) = "" oContents(20) = "" oContents(22) = "" oContents(24) = "" oContents(26) = "" oContents(28) = "" oContents(30) = "" oContents(32) = "" oContents(34) = "" oContents(36) = "" oContents(38) = "" oContents(40) = "" oContents(1) = "" oContents(3) = "" oContents(5) = "" oContents(7) = "" oContents(9) = "" oContents(11) = "" oContents(13) = "" oContents(15) = "" oContents(17) = "" oContents(19) = "" oContents(21) = "" oContents(23) = "" oContents(25) = "" oContents(27) = "" oContents(29) = "" oContents(31) = "" oContents(33) = "" oContents(35) = "" oContents(37) = "" oContents(39) = "" oContents(41) = "" ' the column widths (defaults to the column title width if not specified) Dim oColumnWidths(1) As Double oColumnWidths(0) = 8 oColumnWidths(1) = 8 oPlacementPoint = ThisApplication.TransientGeometry.CreatePoint2d(38, 26) ' Create the custom table Dim oCustomTable As CustomTable oCustomTable = oSheet.CustomTables.Add("Table1", oPlacementPoint, _ 2, 21, oTitles, oContents, oColumnWidths) ' Change the 3rd column to be left justified. ' oCustomTable.Columns.Item(1).ValueHorizontalJustification = kAlignTextLeft ' oCustomTable.Columns.Item(4).ValueHorizontalJustification = kAlignTextLeft ' Create a table format object Dim oFormat As TableFormat oFormat = oSheet.CustomTables.CreateTableFormat ' inside line color to red. oFormat.OutsideLineColor = ThisApplication.TransientObjects.CreateColor(0, 0, 0) oFormat.InsideLineColor = ThisApplication.TransientObjects.CreateColor(0, 0, 0) ' outside line weight. oFormat.OutsideLineWeight = 0.05 oFormat.InsideLineWeight = 0.05 ' Modify the table formats oCustomTable.OverrideFormat = oFormat End Sub
Solved! Go to Solution.