I've build a model that uses feedback variables through X number of iterations within a for loop to manipulate a raster. Due to space limitations, I want to delete the previous variable after it has been used in the next iteration. For example, Raster-->Raster Calculator = Raster1-->Raster Calculator = Raster2--> Delete Raster1, Next iteration Raster2--> Raster Calculator = Raster3-->Delete Raster2 ...and so on, keeping the final iteration output.
Anyone got any experience putting something like this together?
Hi, Can you let the last output of the iteration that you want to delete and use in feedback be overwritten for each iteration rather than creating a new one per iteration? This way you don't need to delete all the outputs except the last. You can do this be leaving the last output name that is not unique for each iteration: c:\Temp\abc : This way the same abc gets created for every iteration.
Try this: Write the output of the Raster Calculator to in_memory/outRaster%Value% (if your rasters are not too big) then add the Copy Raster tool after that. Connect the output of the raster calculator as input to the copy raster tool. Let the output of the copy raster be something like this: C:/Temp.gdb/CopyRaOut. Do not use %Value% her.