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!

Upper case selected text 1

Status
Not open for further replies.

LuKeUmbo

Automotive
Nov 21, 2018
15
IT
Hi to all,

I'm looking for a way to change to upper case selected texts in a drawing but I can't find how to do it

I've tried to modify a macro found on web to change every text in drawing but it dosen't work

I don't know Catia/vba/script coding so maybe is easy to do but I can't figure out where is the error

Someone can help me?

Code:
Language="VBSCRIPT"
Sub CATMain()
Dim oSel as Selection
Set oSel=CATIA.ActiveDocument.selection
For i = 1 To oSel.Texts.Count
oSel.Texts.Item(i).Text = UCase(oSel.Texts.Item(i).Text)
Next
End Sub

Thanks
 
Replies continue below

Recommended for you

Code:
Sub CATMain()
Dim oSel As Selection
Set oSel = CATIA.ActiveDocument.Selection
Dim myText
For i = 1 To oSel.Count
    Set myText = oSel.item(1).Value
    myText.text = UCase(myText.text)
Next
End Sub
this relies on you already selecting a text on your drawing

regards,
LWolf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top