2

I want to run a custom tool created with the Model Builder in ArcGIS. It needs to output to the SAME file each time it runs, just adding the data. Basically I have a custom Dissolve tool that will dissolve (in this case) counties together based on user selection. I need a single file containing ALL the dissolved final shapes, but the Model Builder complains unless each output file is unique. Is there anyway around this or do I have to create dissolve_1, dissolve_2, etc... (to 500 or so) and then combine them afterwards?

underdark
  • 84,148
  • 21
  • 231
  • 413
Josh
  • 1,162
  • 3
  • 14
  • 29

2 Answers2

2

It seems to me like the easiest way to accomplish this task is to

  1. create a new empty output layer/feature class,
  2. dissolve the multiple inputs to a scratch (or better yet, an in_memory layer) and,
  3. APPEND or MERGE them together into your designated output file.
RyanKDalton
  • 23,068
  • 17
  • 110
  • 178
1

One method to create unique names in Model Builder is to add %n% into the output parameter. In your case, the proper usage would be dissolve_%n%

For example

enter image description here

Or if you would like to create unique names by list position, use %i%

enter image description here

Reference: Examples of in-line variable substitution with ModelBuilder system variables

Aaron
  • 51,658
  • 28
  • 154
  • 317
  • My understanding of this is that it only works if you use a Loop. Running the tool multiple unique times would create an error as it resets to 0 (and therefore the name is Buffer0 each time). – Josh Jul 18 '13 at 17:19
  • I'm not sure how to get access to this in model builder (it may not be possible), but Create Unique Name would solve this issue. – Paul Jul 18 '13 at 17:28
  • @Josh, so you need a tool that searches for the last unique name in the run (e.g. dissolve_4) and names the new output "dissolve_5"...? How about list position %i%? – Aaron Jul 18 '13 at 17:38
  • That might have worked. The simplest way to deal with my problem was in the answer by Ryan - append to an already existing file. – Josh Jul 18 '13 at 17:41