2

I am using ModelBuilder to get some results (using various tools) and assign the results to a .dbf file. Each time the For loop runs the program calculates some values and assigns it to designated rows of the export.dbf file. For that I am using "Calculate Field" Tool. This tool assigns the calculated value i.e OFIPS, DFIPS, SNO, NearFID and NearDist to designated rows of Export.dbf. The tool works really quick (1-2 secs) at first but keeps on slowing down (8-10 secs) after say, hundreds of iterations. The speed of the "Calculate field" tool is critical to the speed of the overall ModelBuilder.

Is there any way that the ModelBuilder not slow down the time for each iteration as the number of iterations increase.

Model Builder

The above screenshot shows the slow part in blue circle.

  • 1
    Can you please outline what your calculate field tools are doing? Are the values linked to inputs somewhere else? – Midavalo Feb 15 '17 at 18:00
  • @Midavalo The Calculate Field tool is assigning the results obtained, i.e NearDist, NearFID, OFIPS and DFIPS – pnkjmndhl Feb 15 '17 at 18:03
  • 1
    Please edit your question to include any response to comments – Midavalo Feb 15 '17 at 18:03
  • 1
    Since that section isn't connected to anything, at what point is it executed during the for loop? – Paul Feb 15 '17 at 18:15
  • @ paul It runs after the tool "get field by values" (far right on the image) and Yes it executes on each loop. From my experience the tool doesnot have to connected to each other to run. – pnkjmndhl Feb 15 '17 at 18:17
1

I have not dissected your model to try and reproduce what you are describing because I think I encountered something similar 5 or so years ago.

In your model I think you should try to replace your multiple Calculate Field tools by writing a single Python script tool that is a wrapper around an arcpy.da.UpdateCursor() so that as you iterate through each row you can apply multiple updates to that row.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.