Batch is an older functionality that does not work with ModelBuilder.
I recommend instead creating a new model with an iterator and embedding your model inside it.
This has the added benefit that you can use ModelBuilder to name the outputs using model variables, instead of having to create and validate each output dataset name.
Model builder absolutely *does* work in batch creator in 10.1, BUT only if each intermediary file is set as a "parameter." Could you please elaborate what you mean by "does not work?"
Also, I thought you could only have one iterator per model. I'm not just iterating down a single list of input. It's more like:
in1.tif + in2.tif = out1
in3.tif + in4.tif = out2
That alone would need two iterators. I'm not sure if that kind of iteration is supported, how to even approach it.
path1 = "in{}.tif".format(%n% * 2 + 1) path2 = "in{}.tif".format(%n% * 2 + 2)
Messages Executing: Model2 10 11 Start Time: Tue Jan 15 12:37:02 2013 Executing (Model 1): Model1 10 11 Start Time: Tue Jan 15 12:37:02 2013 Executing (Calculate Value): CalculateValue 10 # Variant Start Time: Tue Jan 15 12:37:02 2013 Value = 10 Executing (Calculate Value): CalculateValue 20 # Variant Value = 20 Succeeded at Tue Jan 15 12:37:02 2013 (Elapsed Time: 0.00 seconds) Executing (Calculate Value (2)): CalculateValue 11 # Variant Start Time: Tue Jan 15 12:37:02 2013 Value = 11 Executing (Calculate Value (2)): CalculateValue 21 # Variant Value = 21 Succeeded at Tue Jan 15 12:37:02 2013 (Elapsed Time: 0.00 seconds) Succeeded at Tue Jan 15 12:37:02 2013 (Elapsed Time: 0.00 seconds) Succeeded at Tue Jan 15 12:37:02 2013 (Elapsed Time: 0.00 seconds)
# script tool that wraps model import sys import os import arcpy Here = os.path.dirname(sys.argv[0]) arcpy.ImportToolbox(os.path.join(Here,"ModelBatchTest.tbx"),"mbt") p1 = arcpy.GetParameterAsText(0) p2 = arcpy.GetParameterAsText(1) arcpy.Model1_mbt(p1,p2) arcpy.AddMessage(arcpy.GetMessages(0))
Executing: Script 10 11 Start Time: Tue Jan 15 12:56:45 2013 Running script Script... Executing: Model1 10 11 Start Time: Tue Jan 15 12:56:46 2013 Executing (Calculate Value): CalculateValue 10 # Variant Start Time: Tue Jan 15 12:56:46 2013 Value = 10 Succeeded at Tue Jan 15 12:56:46 2013 (Elapsed Time: 0.00 seconds) Executing (Calculate Value (2)): CalculateValue 11 # Variant Start Time: Tue Jan 15 12:56:46 2013 Value = 11 Succeeded at Tue Jan 15 12:56:46 2013 (Elapsed Time: 0.00 seconds) Succeeded at Tue Jan 15 12:56:46 2013 (Elapsed Time: 0.00 seconds) Completed script Script... Executing: Script 20 21 Running script Script... Executing: Model1 20 21 Start Time: Tue Jan 15 12:56:46 2013 Executing (Calculate Value): CalculateValue 20 # Variant Start Time: Tue Jan 15 12:56:46 2013 Value = 20 Succeeded at Tue Jan 15 12:56:46 2013 (Elapsed Time: 0.00 seconds) Executing (Calculate Value (2)): CalculateValue 21 # Variant Start Time: Tue Jan 15 12:56:46 2013 Value = 21 Succeeded at Tue Jan 15 12:56:46 2013 (Elapsed Time: 0.00 seconds) Succeeded at Tue Jan 15 12:56:46 2013 (Elapsed Time: 0.00 seconds) Completed script Script... Succeeded at Tue Jan 15 12:56:46 2013 (Elapsed Time: 1.00 seconds)