Using Python Unique ID’s for Existing Feature Classes in ArcGIS 10

This has always been a problematic endeavour for users of ESRI products. Previously, in ArcGIS 9.3 or before, unique ID’s could be generated via a visual basic script. This script could be turned into a button and placed anywhere on the toolbar. The ArcGIS 10 environment has shifted from visual basic to the more industry standard python language and this can be confusing for some.

This method involves a minor bit of programming in python. It involved invoking the Universally Unique Module in python. It should be noted there are many other ways of doing this from python.

Step 1. Create a field called “ENT_GUID” in an existing feature class/shapefile. The field should be a String with a value of 38.

Step 2: Start and editing session and right-click on “ENT_GUID” field header and select Field Calculator.

Step 3: Under Parser ensure that Python is selected as well as Show Codeblock is checked. Type the following in the appropriate boxes.

————————————————–

Pre-Logic Script Code

def CalcGUID():
import uuid
return ‘{‘ + str(uuid.uuid4()).upper() + ‘}’

  ENT_GUID

CalcGUID()

—————————————————-

Your input should look something like that below. Don’t worry about checking the radio button for String as ArcGIS automatically assumes it since it is a string field.


Step 4: Verify your results by making sure the ENT_GUID field is populated with a 38 digit character.

Lake Wanapitei to the Sturgeon River


Download Entire Map

16-Bit TIF (Highest Quality). Download
8-Bit PDF (Good Quality). Download

Using XTools Pro to Generate Customized XML Reports

XTools Pro is an excellent 3rd party extension for ArcGIS that allows users to simplify a variety of tasks. One of the most useful features is its ability to generate feature reports. This is fairly important as the new release of ArcGIS 10 does not include Crystal Reports and the ‘Create Report’ wizard (which can be found if customizing the toolbar) is relatively limited.

It comes with three standard xml forms that can be used, however customized forms can be added in the following folder: C:\Program Files (x86)\DataEast\XToolsPro 7.1\Data. The customized forms need to have the basic structure of the provided forms; however they can be altered sufficiently to meet most needs. The real power of these forms is their ability to display related data (something that is sorely lacking in the current ArcGIS build) without advanced programming knowledge.

Below is an example of an output with altered fonts/sizes. Each output can be exported directly to Microsoft Word, Adobe PDF or as an email. Logos and other background images can be added via some programming as well.