Show Navigation | Hide Navigation
You are here:
Geoprocessing > Automating your work with scripts > Scripting object: Properties and Methods > Properties and Methods

CreateScratchName method

Release 9.3
Last modified January 19, 2010
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Properties and Methods"

Related Topics

Note: This topic was updated for 9.3.1.

Creates a scratch path name of the given data type.

A number is appended to the scratch base name and increased until unique. If no workspace is given, the current workspace is used. If the prefix is blank, then xx is used.


object.CreateScratchName({prefix} As String, {suffix} As String, {dataType} As String, {workspace} As String)

{} = optional

Part Description
object The instantiated geoprocessing object.
prefix The prefix added to the scratchname. By default a prefix of xx is used.
suffix The suffix added to the scratch name.
dataType The data type on which the scratch name will be based.
  • Coverage
  • Dataset
  • FeatureClass
  • FeatureDataset
  • Folder
  • Geodataset
  • GeometricNetwork
  • ArcInfoTable
  • NetworkDataset
  • RasterBand
  • RasterCatalog
  • RasterDataset
  • Shapefile
  • Terrain
  • Workspace
workspace The workspace used as the scratch path name.


import arcgisscripting
gp = arcgisscripting.create(9.3)

# scratch_shp will be ''c:/temp/xxxx0.shp''. If xxxx0.shp already exists, then 
#   the number will be incremented until unique.
scratch_shp = gp.createscratchname("xxxx","","shapefile","c:/temp")

gp.buffer_analysis("c:/transport/roads", scratch_shp, "100 feet")
gp.clip_analysis(scratch_shp, "c:/boundaries/county.shp", "c:/boundaries/clipped_buffer.shp")

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.