ArcPy Layer Class dataType values

11-09-2011 05:40 AM
Occasional Contributor III
On the Arcpy.mapping.Layer class help, it explains that ArcMap layers have a dataType property that stores a layer's source 'Type' like Shapefile, or Geodatabase, or SDE, Raster, etc.  I would like to see a full list of possible values for this dataType property but can't seem to find it in the help.  Anyone know where it is?

For now, I mainly need to know how to specifically identify layers who sources are shapefile, personal geodatabase, file geodatabase, or SDE, since I'll need to handle each of these categories in different ways.  Also need to identify if a standalone table in an MXD is dbf, personal geodatabase, file geodatabase, or SDE.  Would be nice to be able to do this without having to create some complex string search on the layers datasource.

Thanks for any help

0 Kudos
1 Reply
MVP Notable Contributor

May be your solution is some combination of the describe object, more info here.

You could try using the dataElementType property?

This bit of python will give you all the data element types as long as they are not in a grouplayer.

mxd = arcpy.mapping.MapDocument("CURRENT")
l = arcpy.mapping.ListLayers(mxd)
for al in l:
 d = arcpy.Describe(al)
 print d.dataelementtype

0 Kudos