Alan Lowbands
Aerospace
Hi,
Does anyone know of a way to alter the text size and text position of a table using a script.
I'm doing some BOMS from csv files and wanted to get them all the same size etc'
I have found a way to size the column width but can't change the text size and text position in each cell.
Looked online but nothing I have found seems to work.
Any pointers would be appreciated
the code I have up to now is below..
thanks
Alan
--------------------------------------------------------------
Sub CATMain()
Set Document = CATIA.ActiveDocument
Dim selection1
Set selection1 = Document.Selection
Set Info = selection1.Item(1)
Dim MyTable
Set MyTable = Info.Value
'---------------------------------------------
Dim selection2
Dim oText1
Set selection2 = Document.Selection
Set Info2 = selection2.Item(1)
Set oText = Info2.Value
oText.SetFontSize 0, 0,3.5
'--BOM A0 sheet-
iCol = 1
iColSize = 45.5
MyTable.SetColumnSize iCol, iColSize
iCol = 2
iColSize = 45.5
MyTable.SetColumnSize iCol, iColSize
iCol = 3
iColSize = 45.5
MyTable.SetColumnSize iCol, iColSize
iCol = 4
iColSize = 45.5
MyTable.SetColumnSize iCol, iColSize
iCol = 5
iColSize = 265
MyTable.SetColumnSize iCol, iColSize
iCol = 6
iColSize = 86
MyTable.SetColumnSize iCol, iColSize
iCol = 7
iColSize = 156
MyTable.SetColumnSize iCol, iColSize
iCol = 8
iColSize = 200
MyTable.SetColumnSize iCol, iColSize
iCol = 9
iColSize = 80
MyTable.SetColumnSize iCol, iColSize
iCol = 10
iColSize = 190
MyTable.SetColumnSize iCol, iColSize
End Sub
Does anyone know of a way to alter the text size and text position of a table using a script.
I'm doing some BOMS from csv files and wanted to get them all the same size etc'
I have found a way to size the column width but can't change the text size and text position in each cell.
Looked online but nothing I have found seems to work.
Any pointers would be appreciated
the code I have up to now is below..
thanks
Alan
--------------------------------------------------------------
Sub CATMain()
Set Document = CATIA.ActiveDocument
Dim selection1
Set selection1 = Document.Selection
Set Info = selection1.Item(1)
Dim MyTable
Set MyTable = Info.Value
'---------------------------------------------
Dim selection2
Dim oText1
Set selection2 = Document.Selection
Set Info2 = selection2.Item(1)
Set oText = Info2.Value
oText.SetFontSize 0, 0,3.5
'--BOM A0 sheet-
iCol = 1
iColSize = 45.5
MyTable.SetColumnSize iCol, iColSize
iCol = 2
iColSize = 45.5
MyTable.SetColumnSize iCol, iColSize
iCol = 3
iColSize = 45.5
MyTable.SetColumnSize iCol, iColSize
iCol = 4
iColSize = 45.5
MyTable.SetColumnSize iCol, iColSize
iCol = 5
iColSize = 265
MyTable.SetColumnSize iCol, iColSize
iCol = 6
iColSize = 86
MyTable.SetColumnSize iCol, iColSize
iCol = 7
iColSize = 156
MyTable.SetColumnSize iCol, iColSize
iCol = 8
iColSize = 200
MyTable.SetColumnSize iCol, iColSize
iCol = 9
iColSize = 80
MyTable.SetColumnSize iCol, iColSize
iCol = 10
iColSize = 190
MyTable.SetColumnSize iCol, iColSize
End Sub