(If you’re using Firefox, then right click and Save Link As)
Download the Create Unique IDs Toolbox – works with ArcGIS 10.1+
View the Source Code
(any donations go towards hosting costs)
** Run this tool from ArcCatalog, and do not have the feature class / table opened anywhere else.
The Creates Unique IDs tool adds a field called UID and creates a unique ID for each record of an input feature class or table. The unique IDs can be grouped based on a common field attribute and also sorted in ascending or descending order. A prefix and suffix can also be added.
There are currently 3 different techniques to create the unique IDs:
UNIVERSALLY UNIQUE IDENTIFIER – random 32 characters, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
RANDOM WITHIN RANGE – unique random numbers within a defined range
INTERVAL – based on a user defined interval
Be sure to view the Tool Help within the tool dialog box for detailed instructions. Also, check the Geoprocessing Results for any error messages.
Here’s a screenshot of the parameters:
I hope someone finds this tool useful. Please leave a comment if you have any questions or problems, and be sure to check out the other tools I’ve created!
Howdy Ian.
Would this tool work on a selected set of records in a feature class?
Thank you, sir.
would you happen to something like this for Arc 10.0?
No, I don’t, sorry. I believe the only reason this tool doesn’t work with 10.0 is because of the use of da cursors. You could pretty easily convert the code to use the standard cursors.
This tool is very useful tool specially if you are working on an attribute table specially during join and relate process.Thanks a lot ian.
Thanks, Glenn!
This was very helpful. Thank you!
One question- is it possible to define the min & max values for a range vs. just the max? I need to generate 5 digit unique ID’s. It would be great to set the range 10000 – 99999
Thanks for the comment, Erik! Currently, there’s no way to do this, but it that functionality could definitely be added.
Does not work with arcmap 10.3.1, I have tried many times, it has error sign at the top line when I add tool box.
Would you fix it?
ERROR
updateParameters Syntax Error: Runtime error Traceback (most recent call last): File “C:\Users\HU_J\Downloads\CreateUniqueIDs\CreateUniqueIDs\CreateUniqueIDs.tbx#CreateUniqueIDs_CreateUniqueIDs.UpdateParameters.py”, line 1, in File “c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\__init__.py”, line 24, in from arcpy.toolbox import * File “c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\toolbox.py”, line 359, in from .management import Graph, GraphTemplate File “c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\management.py”, line 26, in import _management File “c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\_management.py”, line 14, in import _graph File “c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\_graph.py”, line 27, in import numpy ImportError: No module named numpy
Hi Joe, the `ImportError: No module named numpy` error is usually a problem with your arcpy install.
Please see my answer here: http://gis.stackexchange.com/a/189384/12159
Hi Ian,
It’s really perfect tool and am just wonder if there’s way when line feature is split the old ID is preserved as parent ID and the two new features after splitting take up the IDs in relation to parent ID.
For example if having line feature with ID TNG00235 I would like when the line is split the child IDs to be like TNG00235_1 and TNG00235_2.
Thanks.
Deo
Hi Deo, glad it’s working for you. I believe you would need a custom split tool developed that would basically recreate the lines and assign the correct IDs. This toolbox will not do that for you. Hope this helps, and thanks for the comment.
Hi Ian,
great Tool! Thx for that.
There is a Setting which is not working. If you chose Tpye:Interval, Group Field: NO, Sort Field Yes,Ascending or Yes,Descending and No Prefix the tool not work.
NameErro: global name ‘current_interval’ is not defined.
Thx for help
Hi,
is their any possibility to generate the unique id’s using the nearest feature method, I was facing the problem that the id’s area generating with reference to the FID’s reference, so the ID for touching/nearest features shold have the continution of previous feature. Please help me on this problem.
Thanks in advance
Regards
Surendra Kumar N