Adding rasters dynamically

Discussion created by modybsystematics-co-il-esridist Employee on Jul 31, 2012
Latest reply on Jul 31, 2012 by modybsystematics-co-il-esridist
Hello all

I am tring to write a script to add rasters to each other. The number of rasters that should be added is a parameter.
In my GDB I have rasters outvwshd1, outvwshd2...
In my script example I try to add three of them.
If I write it hard coded it works.
If I create the string of added rasters dynamically I get the error str does not have method ???save???
This is because the ???outRas = param??? takes the param as string and does not really understand that it is a command.
Maybe there is some kind of unquote I can do here??
One solution is to use the function but then I have to run it twice for three rasters. I think it will be slower.

Does anybody has a solution?