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.
if you give pt in the inputbox the previous code should work like a charm.you said:how can i set running number. e.g pt1 pt2 pt3 etc?
Sub CATMain()
Dim USel As Selection
Dim InputObject(0)
Dim oStatus
InputObject(0) = "AnyObject"'selection filter forces user to select specific objects, AnyObject allows selection of any object
Set USel = CATIA.ActiveDocument.Selection
Msgbox "This macro will give you the name of a selected element, you have to select the FINISH button on the Tools Palette when you want to finish selecting" & vbCrLf & "This method work only with selection in Specification Tree"
USel.Clear'You should clear the selection before making a selection
oStatus = USel.SelectElement3(InputObject, "Select objects to list names", True,CATMultiSelTriggWhenUserValidatesSelection, False)
If (oStatus = "Cancel") Then
Exit Sub
End If
sPrefix=InputBox("String for prefix", "input", "prefix")
For i=1 to USel.Count
USel.Item(i).Value.Name = Cstr(sPrefix) & "." & i & "_" & USel.Item(i).Value.Name
Next
End Sub