ScriptSpot

Forum topic · General Scripting

max script inserts content and saves incrementally

By Waltez · 2015-12-31

Description

This script works
----------------------------
max select all
max delete

mergemaxfile "D:\Dati_Max_9.0\V-Ray\VR_BlocK\Am025_Vray\050.max"
savemaxfile "D:\Dati_Max_9.0\V-Ray\VR_BlocK\Am025_Vray_mod\050.max"
-------------------------------------------------------------------

but every time I enter the numbers of the name of the file 051.max ..

how can I create a function that does this automatically from a file to the file 051.max 090.max

I tried this but it does not work

----------------------------------------------------
max select all
max delete

for i = 51 to 52 do

(
filename = "0" + (i as string)
mergemaxfile "D:\Dati_Max_9.0\V-Ray\VR_BlocK\Am025_Vray\0"+(i as string) + ".max"
savemaxfile "D:\Dati_Max_9.0\V-Ray\VR_BlocK\Am025_Vray_mod\0"+(i as string) + ".max"
)
--------------------------------------------------------------------------------------------------
can someone help me

thank you

Comments (1)

`

pixamoon · 2016-01-01

try to just add parenthesis


for i = 51 to 52 do
(
mergemaxfile ("D:\\Dati_Max_9.0\\V-Ray\\VR_BlocK\\Am025_Vray\\0"+(i as string) + ".max")
savemaxfile ("D:\\Dati_Max_9.0\\V-Ray\\VR_BlocK\\Am025_Vray_mod\\0"+(i as string) + ".max")
)