<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic UpdateLayerTime() works on 10.2.2? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/updatelayertime-works-on-10-2-2/m-p/645122#M50290</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am pretty new with Python and I am trying to do something quite simple but it doesn't work. I am trying to add automatically a layer in a mxd document and I want that this layer takes the symbology and the time properties from another layer file. I get the symbology using UpdateLayer() function, and it works, but I try to get the time properties using UpdateLayerTime() function but it doesn't work. The script runs well and I don't get any error message but when I open the layer in ArcMap the time properties are not enabled. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't get where the error is, so I am wondering if it's maybe that this function doesn't work at all. I am using 10.2.2. Please find below an extract of the code.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;mxd = arcpy.mapping.MapDocument(template)&lt;/P&gt;&lt;P&gt;df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Modify the properties of the layer with the layer file template&lt;/P&gt;&lt;P&gt;AddLayer = arcpy.mapping.Layer(LyrFile)&lt;/P&gt;&lt;P&gt;sourceLayer = arcpy.mapping.Layer(r'C:\Arcdata\Dis_template.lyr')&lt;/P&gt;&lt;P&gt;arcpy.mapping.UpdateLayerTime(df,AddLayer,sourceLayer)&lt;/P&gt;&lt;P&gt;arcpy.mapping.UpdateLayer(df,AddLayer,sourceLayer,True)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate any light on this.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jose&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Dec 2014 10:53:06 GMT</pubDate>
    <dc:creator>JoseEduardo_Moyano_Capilla</dc:creator>
    <dc:date>2014-12-11T10:53:06Z</dc:date>
    <item>
      <title>UpdateLayerTime() works on 10.2.2?</title>
      <link>https://community.esri.com/t5/python-questions/updatelayertime-works-on-10-2-2/m-p/645122#M50290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am pretty new with Python and I am trying to do something quite simple but it doesn't work. I am trying to add automatically a layer in a mxd document and I want that this layer takes the symbology and the time properties from another layer file. I get the symbology using UpdateLayer() function, and it works, but I try to get the time properties using UpdateLayerTime() function but it doesn't work. The script runs well and I don't get any error message but when I open the layer in ArcMap the time properties are not enabled. &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't get where the error is, so I am wondering if it's maybe that this function doesn't work at all. I am using 10.2.2. Please find below an extract of the code.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;mxd = arcpy.mapping.MapDocument(template)&lt;/P&gt;&lt;P&gt;df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Modify the properties of the layer with the layer file template&lt;/P&gt;&lt;P&gt;AddLayer = arcpy.mapping.Layer(LyrFile)&lt;/P&gt;&lt;P&gt;sourceLayer = arcpy.mapping.Layer(r'C:\Arcdata\Dis_template.lyr')&lt;/P&gt;&lt;P&gt;arcpy.mapping.UpdateLayerTime(df,AddLayer,sourceLayer)&lt;/P&gt;&lt;P&gt;arcpy.mapping.UpdateLayer(df,AddLayer,sourceLayer,True)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate any light on this.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jose&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2014 10:53:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/updatelayertime-works-on-10-2-2/m-p/645122#M50290</guid>
      <dc:creator>JoseEduardo_Moyano_Capilla</dc:creator>
      <dc:date>2014-12-11T10:53:06Z</dc:date>
    </item>
  </channel>
</rss>

