Message 1 of 2
iLogic Changing Text Style of Custom Table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi forum
I have a question regarding switching the data text style to an existing one to get the appropriate font size I need. Currently, the default table style is "CLE- A-SIZE DATA" and I want to switch it to "CLE- D-SIZE DATA". I'd like to avoid changing the font size of "CLE- A-SIZE DATA". Reason being, the A-SIZE DATA text style is being used elsewhere on the title block and would mess up the formatting. Is there a way to switch the text style or even override the font size?
'Open on idw
Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument Dim oSheet As Sheet = oDrawDoc.ActiveSheet Dim oTitles(2) As String oTitles(0) = "Part Number" oTitles(1) = "Quantity" oTitles(2) = "Material" Dim oContents(8) As String oContents(0) = "1" oContents(1) = "1" oContents(2) = "Brass" oContents(3) = "2" oContents(4) = "2" oContents(5) = "Aluminium" oContents(6) = "3" oContents(7) = "1" oContents(8) = "Steel" Dim oColumnWidths(2) As Double oColumnWidths(0) = 2.5 oColumnWidths(1) = 2.5 oColumnWidths(2) = 4 oPlacementPoint = ThisApplication.TransientGeometry.CreatePoint2d(15, 15) Dim oCustomTable As CustomTable oCustomTable = oSheet.CustomTables.Add("My Table", oPlacementPoint, _ 3, 3, oTitles, oContents, oColumnWidths) Dim oFormat As TableFormat = oSheet.CustomTables.CreateTableFormat Dim oTextStyleName As String Dim t As Integer = 1 Do Until t = 22 oTextStyle = oDrawDoc.StylesManager.TextStyles(t) oTextStyleName = oTextStyle.Name If oTextStyleName = "CLE- D-SIZE DATA" Exit Do End If t = t + 1 Loop oFormat.TextStyle = oTextStyle 'oCustomTable.DataTextStyle.FontSize = .5 ' oTextStyle.FontSize 'oCustomTable.DataTextStyle.Name = "CLE- D-SIZE DATA" 'oCustomTable.OverrideFormat.TextStyle.FontSize = .5
Best regards,
Felix Cortes