Notifications
Clear all

[Closed] seek and rename

Is it possible to create a seek and rename tool with maxscript?
I have hundreds scene groups with specifics names. I want to replace a “-s” by “-12” for all of them.
example name :
72001-S-4
72001-S-3
72002-S-01
72005-S-04

want this :
72001-12-4
72001-12-3
72002-12-01
72005-12-04

Thx guys

8 Replies

install the blur scripts pack (from scriptspot…?), there is a renamer script which does exactly what you want.

 PEN

There is no error checking of course.


 fn replaceStrFn inStr replaceStr newStr=
 (
 	str=filterString inStr replaceStr
 	outStr=str[1]+newStr+str[2]
 )
   
   --test
 inStr="72001-S-4"
 replaceStr="-S-"
 newStr="-12-"
 replaceStrFn inStr replaceStr newStr
 
 --Loop through a selection of objects and change their names. 
 For x in selection do (x.name=replaceStrFn x.name replaceStr newStr)
 

thx Paul, but I can t make it works

 PEN

Can you ellaborate?

I first test the blur’s one. but Failed because only works for objects, no groups.
And then yours, whithout GUI, I don t understand very well because I m not a scripter. I test it in the Maxscript Listener window but nothing happened.

Hi, try this one i made some time ago:

you can customize the tools menu and add this or assign it to a hotkey or button (under category Zbuffer)

Zbuffer This is perfect. It works fine ! thx!! very time saver for me!

u can also try this script with a UI for renaming multiple objects:
http://www.aaachooo.com/files/maxscripts/SM_ObjectRenamer.ms

can be used to rename all objects in the scene or to a selection.
Treats biped ojects differently …