SetProgressorLabel (arcpy)

Resumen

Updates the progressor dialog box label.

Sintaxis

SetProgressorLabel (label)
ParámetroExplicaciónTipo de datos
label

The label to be used on the progressor dialog box.

String

Ejemplo de código

SetProgressorLabel example

Updates the progressor dialog box label.

import arcpy
 
# Allow overwriting of output 
# 
arcpy.env.overwriteOutput = True
 
# Set current workspace 
# 
arcpy.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(arcpy.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(shp, "fgdb.gdb/" + fc) 

  # Update the progressor position 
  # 
  arcpy.SetProgressorPosition()

arcpy.ResetProgressor()

Temas relacionados

9/11/2013