How to rename without white spaces in 3dmax objects

May I ask if I want to remove all white space form objects name.
I am a beginner and don't know how to do.
and thanks for answer.

fn FindAndReplaceAll str fnd rpl = 
(
	local addpos, fndcount = fnd.count
	while ((addpos = findString str fnd) != undefined) do ( str = replace str addpos fndCount rpl )
)
sel=objects as array
for str in sel do FindAndReplaceAll str.name " " ""

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
fajar's picture

using this String Parser

using this

String Parser Methods : isSpace " MAXScript" --first character is space
johnsu6616's picture

.

Thank you for sharing the information.

johnsu6616's picture

.

thank you so much.
great example for me!
fix all object name without space and tab
and thanks again

sel=objects as array
for s in sel do
s.name = RemoveAllWhiteSpace s.name
jahman's picture

.

fn RemoveAllWhiteSpace inputString = (
 
	local outputString = StringStream ""
	for x in filterString inputString " \t\r\n" do format "%" x to:outputString
	outputString as string
 
)
 
RemoveAllWhiteSpace " <- Space And Tab ->	"

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.