SetProgressorPosition (arcpy)
Резюме
Обновляет строку состояния в диалоговом окне прогрессора.
Синтаксис
SetProgressorPosition ({position})
| Параметр | Объяснение | Тип данных | 
| position | Настройка положения строки состояния в диалоговом окне прогрессора. | Integer | 
Пример кода
Пример настройки положения строки состояния в прогрессоре
Изменяет положение строки состояния в диалоговом окне прогрессора.
import arcpy
from arcpy import env
 
# Allow overwriting of output 
# 
env.overwriteOutput = True
 
# Set current workspace 
# 
env.workspace = "c:/data" 
# Get a list of shapefiles in folder 
# 
fcs = arcpy.ListFeatureClasses() 
# Find the total count of shapefiles in list 
# 
fcCount = len(fcs) 
# Set the progressor 
#
arcpy.SetProgressor("step", "Copying shapefiles to geodatabase...", 0,fcCount, 1) 
# Create a file gdb to contain new feature classes 
#
arcpy.CreateFileGDB_management(env.workspace, "fgdb.gdb") 
# For each shapefile, copy to a file geodatabase 
# 
for shp in fcs: 
    # Trim the '.shp' extension 
    # 
    fc = shp.rstrip(".shp") 
    # Update the progressor label for current shapefile 
    # 
    arcpy.SetProgressorLabel("Loading " + shp + "...") 
    # Copy the data 
    # 
    arcpy.CopyFeatures_management(shp, "fgdb.gdb/" + fc) 
    # Update the progressor position 
    # 
    arcpy.SetProgressorPosition()
arcpy.ResetProgressor()
Связанные темы
9/10/2013