ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
miauu, does not works correct. We have only #(1, 3, 5, 15, 18, 22). String "-" doesnot want converted to "..", it converts only to "." , because it increase string.count in cycle.
fn convertStringToArray string =
(array = #()if(numA = filterstring string ",").count > 1 do(for i in numA do(if(e = i as number)!= undefined then append array e else(if(numB = filterstring i "-").count == 2 do(if(f = numB[1] as number)!= undefined and (s = numB[2] as number)!= undefined do(for j = f to s do append array j
))))) ; array)
convertStringToArray "1, 3, 5-12, 21-23"
Comments
barigazy, your code works
barigazy, your code works well - Thanks!
miauu, does not works correct. We have only #(1, 3, 5, 15, 18, 22). String "-" doesnot want converted to "..", it converts only to "." , because it increase string.count in cycle.
.
I wrote my code using 3dsMax 2014 and it works correctly.
Watch the video: https://dl.dropboxusercontent.com/u/53119355/Other_Videos/Str_To_Array_v...
Tools and Scripts for Autodesk 3dsMax
Yes - it works in 2014 but
Yes - it works in 2014 but not in 2010.
.
Yep. In 3dsMax 2010 it not works. AD should tells why.
Tools and Scripts for Autodesk 3dsMax
and it is interesting..for
and it is interesting..for example in this theme: http://www.scriptspot.com/forums/3ds-max/general-scripting/extrude-not-w... i have opposite problem - in 2010 works well, in 2013 - not works extrude with spinner correctly )
.
As one friend of mine said once - "this is max my friend, this is max"
:)
Tools and Scripts for Autodesk 3dsMax
.
Am ugly solution :)
Tools and Scripts for Autodesk 3dsMax
Convert Text to Array
How to convert text "1,3,5-12" to array #(1,3,5,6,7,8,9,10,11,12) ?
...
Try with this function
bga