Monday, May 9, 2011

Using fields and indexes

Feature classes and tables have fields properties that returns a list of fields objects when described.  Each field or index object has a number of properties that can be used to explore the object.  Alternately, the ListFields() and ListIndexes() can be used to also create the same lists. 


# Describe feature class
desc = arcpy.Describe(fc)
# Get Fields
fields = desc.fields
for field in fields:
   # do something with the field
   print field. name

The properties of the field and index object are below: