Select to view content in your preferred language

Automating output names in Model Builder

4775
2
Jump to solution
09-21-2014 05:29 PM
EuanForsyth
New Contributor

Hi,

 

I have a simple model that consists of three point data sets; set A is a selection of residential points on which the model is to be run, set B is a collection of street intersection points and set C is all the residential points. The model works as thus...

 

  1. Select a point from set A
  2. Generate a buffer around this point
  3. Count the number of points from sets B and C that intersect the buffer (in separate fields)
  4. Calculate the density of these points (again, in separate fields)
  5. Move on to the next point in set A and rinse and repeat

 

This simple model works fine, the problem, however, arises at the end where every iteration of the model writes to the same output file, meaning that each iteration is overwriting its predecessor -- which isn't quite what I want!

 

My question, therefore, is; is there some way to automatically change the file output name with every iteration of the model (so the name would be changed to something like output_1, output_2, output_3, 4, 5 etc... every time the model runs)?

 

As an aside, I, unfortunately, have quite limited Python skills at the moment (as in I'm just past "Hello world!" level!), so any solution that requires large amounts of tailor made scripting on my part would probably not be very feasible. Although I *may* be able to get help in this regard if tailor made scripting is the only viable solution.

 

Nevertheless, any help would be much appreciated

 

Regards,

Euan

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
RiyasDeen
Regular Contributor

Hi Euan,

You can use Iterator to iterate through your feature selection. ArcGIS Desktop .

Use object ID as your fields, then you can access the object ID for each iteration as %Value%.

Set your buffer feature class name as <<Feature Dataset>>\output_%Value%

View solution in original post

0 Kudos
2 Replies
RiyasDeen
Regular Contributor

Hi Euan,

You can use Iterator to iterate through your feature selection. ArcGIS Desktop .

Use object ID as your fields, then you can access the object ID for each iteration as %Value%.

Set your buffer feature class name as <<Feature Dataset>>\output_%Value%

0 Kudos
EuanForsyth
New Contributor

Hi Riyas,

That works perfectly, thanks!

0 Kudos