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.

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Feb 15, 2017 at 17:57
11
  • 1
    Can you please outline what your calculate field tools are doing? Are the values linked to inputs somewhere else? Commented Feb 15, 2017 at 18:00
  • @Midavalo The Calculate Field tool is assigning the results obtained, i.e NearDist, NearFID, OFIPS and DFIPS Commented Feb 15, 2017 at 18:03
  • 1
    Please edit your question to include any response to comments Commented Feb 15, 2017 at 18:03
  • 1
    Since that section isn't connected to anything, at what point is it executed during the for loop? Commented Feb 15, 2017 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. Commented Feb 15, 2017 at 18:17

1 Answer 1

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.

answered Feb 16, 2017 at 3:57

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.