Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Rename with inputbox

Status
Not open for further replies.

HarunMusic

Computer
Joined
Nov 21, 2014
Messages
71
Location
BA
Hi, i have problem with this script, i dont know how to use text from input Box,i want to taype name or part of name(prefix, sufix) and change it with the name also from input box, pls help
Sub CATMain()
Dim partDocument1 'As PartDocument
Set partDocument1 = CATIA.ActiveDocument
set selection1=CATIA.ActiveDocument.Selection

Window1 = InputBox("Type the name u want change: ", "Change the name of body,point, etc")

selection1.search="Name= &Window1&*,all"
Window = InputBox("Type the new name: ", "Change the name of body,point, etc")

For I = 1 To selection1.Count

selection1.Item(I).Value.Name = Replace(selection1.Item(I).Value.Name, " & Window1 & ",Prozor)

next
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top