Workaround for Arcgis batch models (or what to do when batching a model just fails)

14 Feb

Ok, so many of you are probably already aware that when you create a model in Arcgis in order to batch it you need to make the variables lists. However, there are sometimes that this just fails and it not allows you to batch your model. I encountered this problem working with a quite complicated model and looking for different solutions I figured out this one. You can just create a script instead of a model, but if you don’t have time or you are not a super scripting nerd 😀 there is another way to make it work. Is actually quite similar to the way you do macros in IDRISI.

For the sake of explanation here Im going to put as example a simple process (create a buffer):

Let’s say you create your model and you want to batch process it.

1.Open the command line either in Arcmap or Arccatalog. To make sure that your model works well before you create your workflow in Excel, enter the parameters of your model in the command line and run it.

2. Once you are sure it is working properly, copy the parameters to a worksheet in excel.

(If you are using arccatalog you can set the absolute paths to your layers, but if you added all the information into an arcmap project the model will take the relative paths so in the parameters you can just input the name of the file rather than the whole path)

3. Once in excel you can just drag down the values filling up the parameters, modifying the names of the files you want to run in subsequent models.

4. Delete all the other sheets in the book (Sheet1,2 and so on TAB/right click/delete). Save as .cvs (Comma delimited).

(This will allow you to modify in the next step the file and save it directly to .txt)

5. Open it your word processor, click Find and Replace. Replace “,” for one space.

6. Save the document as .TXT

7. Open it in Notepad.

8. Copy and paste all in the command line and run it! (you are ready to go for a nice coffee while the machine works for you :D)

You can do the same with more complex models, just add the parameters that are necessary in your model.

Have a great day!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: