Recursively executes a command on each object that matches a specified wildcard OR on each object listed in a text file.
To set your Current Workspace, use the Environment Settings dialog box (click on [Environments...] and then General Settings) before running the tool.
BatchProcess <Wildcard_or_Text_File> <all feature classes | coverage | coverage feature class | dbase | file | geodatabase | geodatabase feature class | info | raster | shapefile> {all | point | label | node | line | arc | route | polygon | region} <Command_String> <run | preview>
Parameters
| Expression | Explanation |
|---|---|
| <Wildcard_or_Text_File> |
The wild card or text file that will be used to identify which objects are to be processed.
|
| <all feature classes | coverage | coverage feature class | dbase | file | geodatabase | geodatabase feature class | info | raster | shapefile> |
The type of object that is to be searched for matches with the Wildcard.
|
| {all | point | label | node | line | arc | route | polygon | region} |
The type of feature class that is to be searched for.
|
| <Command_String> |
The command string that is to be executed recursively.
|
| <run | preview> |
Whether to RUN the Command String recursively or to just PREVIEW what the Command String will like like after each substitution.
|
Command Line Example
Workspace c:\workspace\test.mdb Set c:\workspace\test.mdb into workspace BatchProcess * "geodatabase feature class" all "copyfeatures ^ c:\workspace\^s" run Executing (BatchProcess_3): BatchProcess * "geodatabase feature class" all "copyfeatures ^ c:\docume~1\dchatfie\mydocu~1\linear~1\^s" run Start Time: Wed May 03 14:16:39 2006 Running script BatchProcess... copyfeatures sx_og_label c:\workspace\sx_og_labels copyfeatures junk1 c:\workspace\junk1s copyfeatures sx_strm_route_long c:\workspace\sx_strm_route_longs copyfeatures sx_og_polygon c:\workspace\sx_og_polygons copyfeatures sx_wshed_region_wshed c:\workspace\sx_wshed_region_wsheds Completed script BatchProcess... Executed (BatchProcess_3) successfully. End Time: Wed May 03 14:16:52 2006 (Elapsed Time: 13.00 secs)
BatchProcess (Wildcard_or_Text_File, Object_Type, Feature_Type, Command_String, Execute_Option)
Parameters
| Expression | Explanation |
|---|---|
| Wildcard or Text File (Required) |
The wild card or text file that will be used to identify which objects are to be processed.
|
| Object Type (Required) |
The type of object that is to be searched for matches with the Wildcard.
|
| Feature Type (Optional) |
The type of feature class that is to be searched for.
|
| Command String (Required) |
The command string that is to be executed recursively.
|
| Execute Option (Required) |
Whether to RUN the Command String recursively or to just PREVIEW what the Command String will like like after each substitution.
|
Script Example
# Import modules.
import sys, string, os, win32com.client
# Create the Geoprocessor object
gp = win32com.client.Dispatch('esriGeoprocessing.GpDispatch.1')
# Load required toolboxes...
gp.AddToolbox('C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx')
# Load DV Linear Referencing toolbox.
gp.AddToolbox('C:/Documents and Settings/dchatfie/Application Data/ESRI/ArcToolbox/My Toolboxes/' + \
'DV Utilities Tools.tbx')
# Set workspace.
gp.workspace = 'c:/workspace/test.mdb'
# Convert all geodatabase feature classes beginning with 'redriver' into shapfiles.
gp.batchprocess('redriver*', 'geodatabase feature class', 'all', 'copyfeatures ^ c:\workspace\^')