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

CreateUniqueName 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.

Returns a unique name

A number is appended to the input name and increased until unique. If no workspace is given, the current workspace is used.


object.CreateUniqueName(inputName As String, {workspace} As String)

{} = optional

Part Description
object The instantiated geoprocessing object
inputName The base name used to create the unique name
workspace The workspace used as the unique path name


import arcgisscripting
gp = arcgisscripting.create(9.3)

# unique_shp will be "c:/temp/xxx0.shp". If xxx0.shp already exists, then 
#   the number will be incremented until unique.
unique_shp = gp.createuniquename("xxx", "c:/temp") + ".shp"

gp.buffer_analysis("c:/transport/roads", unique_shp, "100 feet")
gp.clip_analysis(unique_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.