Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deafting text multiple lines - change font size only for one line 1

Status
Not open for further replies.

iscariot

Mechanical
Oct 15, 2009
154
DE
Is it possible with automation to change the font size only for one line of text?
 
Replies continue below

Recommended for you

you can use the Get/SetParameterOnSubString to modify only on line of the text.

Code:
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

Eric N.
indocti discant et ament meminisse periti
 
Thank you, it works with the mention that Font Size must be multiplied with 1000. I'm not sure why.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top