jonmulder

Create a Time-Enabled Layer in Arcpy

Discussion created by jonmulder on Dec 24, 2013
Latest reply on Jan 3, 2014 by jonmulder
I guess I should be sipping eggnog today, but I'm getting hooked on the Python scripting...

I want to time-enable a layer (have time-enabled it in ArcMap so it is a good featureclass) in Arcpy.  Does someone have a snippet of code they could share?  Below is my start but it errors out on     "lyrTime = lyr.Time" saying  AttributeError: 'str' object has no attribute 'Time'

Jon Mulder

LayerFileLocation = "H:\Documents\GIS\HydstraData"
LayerName = "CasedContours.lyr"
lyr = os.path.join(LayerFileLocation,LayerName)
arcpy.mapping.Layer(lyr).supports("TIME")
lyrTime = lyr.Time

Outcomes