<?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 problem with python code exporting to png with time enabled layer in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/problem-with-python-code-exporting-to-png-with/m-p/39746#M3156</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using the ESRI sample code to export a mxd to a series of .PNG files. I set all parameters e.g. Startime, endtime.. etc. When I use the time slider, the changes on map appear correctly (different maps for different time-steps), But when I export it using the python code it create a series of PGN of the same map (it seems like pgns are several copies of the original map).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know why it works in ArcMap but not when exporting. Any help would be greatly appreciated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy, datetime&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument(r"D:\project3.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df = arcpy.mapping.ListDataFrames(mxd,"layers")[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df.time.resetTimeExtent()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df.time.timeWindowUnits = "days"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df.time.timeWindow = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df.time.currentTime = datetime.datetime(1905, 06, 26)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;endTime = datetime.datetime(1905, 07, 4)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;interval = datetime.timedelta (days=2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while df.time.currentTime &amp;lt;= endTime:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fileName = str(df.time.currentTime).split(" ")[0] + ".png"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPNG(mxd, r"D:\\" + fileName,df)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.time.currentTime = df.time.currentTime + interval&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print fileName&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del mxd&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Apr 2012 18:40:45 GMT</pubDate>
    <dc:creator>LeilaHashemi</dc:creator>
    <dc:date>2012-04-03T18:40:45Z</dc:date>
    <item>
      <title>problem with python code exporting to png with time enabled layer</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-python-code-exporting-to-png-with/m-p/39746#M3156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using the ESRI sample code to export a mxd to a series of .PNG files. I set all parameters e.g. Startime, endtime.. etc. When I use the time slider, the changes on map appear correctly (different maps for different time-steps), But when I export it using the python code it create a series of PGN of the same map (it seems like pgns are several copies of the original map).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know why it works in ArcMap but not when exporting. Any help would be greatly appreciated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy, datetime&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;mxd = arcpy.mapping.MapDocument(r"D:\project3.mxd")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df = arcpy.mapping.ListDataFrames(mxd,"layers")[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df.time.resetTimeExtent()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df.time.timeWindowUnits = "days"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df.time.timeWindow = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;df.time.currentTime = datetime.datetime(1905, 06, 26)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;endTime = datetime.datetime(1905, 07, 4)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;interval = datetime.timedelta (days=2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while df.time.currentTime &amp;lt;= endTime:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fileName = str(df.time.currentTime).split(" ")[0] + ".png"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPNG(mxd, r"D:\\" + fileName,df)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; df.time.currentTime = df.time.currentTime + interval&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print fileName&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;del mxd&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2012 18:40:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-python-code-exporting-to-png-with/m-p/39746#M3156</guid>
      <dc:creator>LeilaHashemi</dc:creator>
      <dc:date>2012-04-03T18:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: problem with python code exporting to png with time enabled layer</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-python-code-exporting-to-png-with/m-p/39747#M3157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Have you tried an arcpy.RefreshActiveView()?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 12:27:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-python-code-exporting-to-png-with/m-p/39747#M3157</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-04-10T12:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: problem with python code exporting to png with time enabled layer</title>
      <link>https://community.esri.com/t5/python-questions/problem-with-python-code-exporting-to-png-with/m-p/39748#M3158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I had a similar issue, and solved it, I was working from my personal machine and using an MXD I created from one of our GIS Servers, and saved it to a Shared Network location. When running the script, it produced the PNGs exactly how you described. When I then ran it from the&amp;nbsp; machine where the MXD, data and python script lived it produced the PNGs with the layers changing per time interval.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2019 16:59:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-with-python-code-exporting-to-png-with/m-p/39748#M3158</guid>
      <dc:creator>JohnLister</dc:creator>
      <dc:date>2019-04-02T16:59:44Z</dc:date>
    </item>
  </channel>
</rss>

