I have the Backgroud_UpperCase_TXT.CATScript from the Catia Portable Script Center that I modified to include text in the main view as well.
The issue that I am running into is that when it changes everything to upper case, text boxes that have text with different formats in it all get changed to one format.
For example, some of the text is bolded and a different size, after the macro is run, all the text in that text box will be bolded and one size.
Is there a way to keep this from happening, I just want to make sure all my text is in upper case, I do not want the formatting to change.
The issue that I am running into is that when it changes everything to upper case, text boxes that have text with different formats in it all get changed to one format.
For example, some of the text is bolded and a different size, after the macro is run, all the text in that text box will be bolded and one size.
Is there a way to keep this from happening, I just want to make sure all my text is in upper case, I do not want the formatting to change.
Code:
Sub CATMain()
Dim sLF
Dim oDoc As Document
Dim sDrawingNumber
Dim oSheet As DrawingSheets
Dim oView As DrawingView
Dim oNewText As DrawingTexts
Dim i As Integer
'----------------
Set oDoc = CATIA.ActiveDocument
Set oSheet = oDoc.Sheets.Item(1)
oSheet.Activate
Set oView = oSheet.Views.Item("Background View")
For i = 1 To oView.Texts.Count
oView.Texts.Item(i).Text = UCase (oView.Texts.Item(i).Text)
Next
Set oView = oSheet.Views.Item("Main View")
For i = 1 To oView.Texts.Count
oView.Texts.Item(i).Text = UCase (oView.Texts.Item(i).Text)
Next
CATIA.ActiveWindow.ActiveViewer.Reframe
End Sub