Now that I've got my "Labels not appearing in map document" resolved (Thanks to Wayne Whitley), I'm back to working on time-enabling two layers in my map document. In looking through threads etc, it seems like the actual dataframe MUST be time-enabled before "time" properties can be assigned to a layer(s) residing in that dataframe.I'm not quite sure how to enable time for the dataframe. Is there something I need to do to the dataframe properties before manipulating the layer property?I've tried the following line:##Enable time for the layer.
arcpy.mapping.Layer(Wells_lyr).supports("TIME")
But I get back:Traceback (most recent call last): File "H:\Documents\GIS\HydstraData\UpdateMxd20131228.py", line 36, in <module> arcpy.mapping.Layer(Wells_lyr).supports("TIME") File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\arcobjects\mixins.py", line 388, in __init__ raise TypeError(repr(type(lyrfile)))TypeError: <class 'arcpy._mapping.Layer'>Failed to execute (UpdateMap).Failed at Sat Dec 28 12:50:31 2013 (Elapsed Time: 0.20 seconds)Complete script shown below:Jon Mulder## Step 1
import arcpy
import arcpy.mapping
import os
OutFolderPath = "H:\Documents\GIS\HydstraData\HydstraMeasurementsDeep"
GeoDatabaseName = "GSE_Daily_Contours_20130625_20130625.gdb"
LayerFileLocation = "H:\Documents\GIS\HydstraData"
##Reference the Current map document.
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
##arcpy.env.workspace = GeoDatabaseName
arcpy.env.workspace = "H:\Documents\GIS\HydstraData"
##Add AllPoints Featureclass to map.
WellsPtsLyrFile = os.path.join(LayerFileLocation,"Template_WellPoints.lyr")
##print Wells_lyr
arcpy.AddMessage(Wells_lyr)
Wells_lyr = arcpy.mapping.Layer(WellPtsLyrFile)
##Replace the Layer DataSource.
Wells_lyr.replaceDataSource(os.path.join(OutFolderPath,GeoDatabaseName),"NONE","WellPoints")
##Show labels for WellPoints.
if Wells_lyr.supports("LABELCLASSES"):
Wells_lyr.labelClasses[0].expression = "[StateWellNumber]"
Wells_lyr.showLabels = True
##Enable time for the layer.
arcpy.mapping.Layer(Wells_lyr).supports("TIME")
arcpy.mapping.AddLayer(df, Wells_lyr, "AUTO_ARRANGE")