Forum Groups
  All forums
    Help & Feedback
      Work in progress
      Finished Art
      Non-Max related

Maxunderground news unavailable

Maxscript - Trim object name to specified amount of characters?
show user profile  jpedleham
I have a model library of about 3000 assets and each of them begins with an 8 character reference code but it may have further codes after it separated by an underscore.

I cant seem to achieve the correct trim function to trim it down to a number of characters.
Id basically like it to remove everything after the first 8 characters from the object name leaving just the reference number. Im sure its something simple im missing or perhaps im using the trim function improperly, im not sure.

If anyone can help id really appreciate it
read 502 times
11/5/2015 10:58:58 AM (last edit: 11/5/2015 10:58:58 AM)
show user profile  Garp
$.name = substring $.name 1 8

read 491 times
11/5/2015 7:38:29 PM (last edit: 11/5/2015 7:38:29 PM)
show user profile  jpedleham
Thanks so much garp, Just so i know, what is the 1 for in that? is that telling it to keep characters 1-8?
read 484 times
11/5/2015 9:12:34 PM (last edit: 11/5/2015 9:12:34 PM)
show user profile  Garp
Search the mxs ref for substring. It's all there.

read 478 times
11/5/2015 10:33:45 PM (last edit: 11/5/2015 10:33:45 PM)
show user profile  jpedleham
Ok thanjs again
read 467 times
11/6/2015 7:54:46 AM (last edit: 11/6/2015 7:54:46 AM)
#Maxforums IRC
Open chat window