iscariot
Mechanical
- Oct 15, 2009
- 154
Is it possible with automation to change the font size only for one line of text?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim oSht As DrawingSheet
Set oSht = CATIA.ActiveEditor.ActiveObject.ActiveSheet
Dim drawingViews1 As DrawingViews
Set drawingViews1 = oSht.Views
Dim drawingView1 As DrawingView
Set drawingView1 = drawingViews1.Item("View.1")
Dim drawingTexts1 As DrawingTexts
Set drawingTexts1 = drawingView1.Texts
Dim drawingText1 As DrawingText
Set drawingText1 = drawingTexts1.Item("Text.1")
Dim subLines As Variant
subLines = Split(drawingText1.Text, vbLf)
linetochange = 2
linePosition = 0
For u = 1 To linetochange - 1
linePosition = 1 + linePosition + Len(subLines(u - 1))
Next
lineLength = Len(subLines(linetochange - 1)) + 1
drawingText1.SetParameterOnSubString catBold, linePosition, lineLength, 1