turnerkyle

where to put setprogressor

Discussion created by turnerkyle on Apr 9, 2012
Latest reply on Apr 9, 2012 by philmorefield
Where do I put my setprogressor statements to get a realistic progress bar?

I initially thought it should be in the outermost loop, but now I'm not sure.

Right now I have something to the effect of:

try:
    for ds in DSs:
       listFCs = gp.ListFeatureClasses("","",ds)
       fcCount = len(listFCs)
       gp.SetProgressor("step", "Listing Feature Classes...", 0, fcCount, 1)
       for fcs in listFCs:
           gp.SetProgressorLabel("Calculating fields for... " + fcs)
           gp.SetProgressorPosition()
           do stuff

           then a bunch of other imbedded if/thens and for in within the above for in statement

except:
 your typical messages

finally:
gp.resetprogressor()

  
(Hopefully the above "code" makes sense/is useful.)

Thanks in advance for your help.

Cheers.

Outcomes