ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

SetProgressor

  • Summary
  • Discussion
  • Syntax
  • Code sample

Summary

Establishes a progressor object which allows progress information to be passed to a progress dialog box. The appearance of the progress dialog box can be controlled by choosing either the default progressor or the step progressor.

Discussion

Since script tools share the application, you have control of the progress dialog box. You can control the appearance of the progress dialog box by choosing either the default progressor or the step progressor, as illustrated below.

Default and step progressor

Syntax

SetProgressor (type, {message}, {min_range}, {max_range}, {step_value})
ParameterExplanationData Type
type

The progressor type (default or step).

  • default —The progressor moves back and forth continuously.
  • step —The progressor shows the percentage complete.

(The default value is default)

String
message

The progressor label. The default is no label.

String
min_range

Starting value for progressor. Default is 0.

(The default value is 0)

Integer
max_range

Ending value for progressor. Default is 100.

(The default value is 100)

Integer
step_value

The progressor step interval for updating the progress bar.

(The default value is 1)

Integer

Code sample

SetProgressor example

Set progressor object for displaying progress in the progress dialog box.

import os
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
fc_count = len(fcs)

# Set the progressor
arcpy.SetProgressor("step", "Copying shapefiles to geodatabase...",
                    0, fc_count, 1)

# Create a file gdb to contain new feature classes
arcpy.CreateFileGDB_management(arcpy.env.workspace, "fgdb.gdb")

# For each shapefile, copy to a file geodatabase
for shp in fcs:
    # Trim the '.shp' extension
    fc = os.path.splitext(shp)[0]

    # Update the progressor label for current shapefile
    arcpy.SetProgressorLabel("Loading {0}...".format(shp))

    # Copy the data
    arcpy.CopyFeatures_management(shp, os.path.join("fgdb.gdb", fc))

    # Update the progressor position
    arcpy.SetProgressorPosition()

arcpy.ResetProgressor()

Related topics

  • ResetProgressor
  • SetProgressorLabel
  • SetProgressorPosition
  • Controlling the progress dialog box

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal