From DataFrameTime—Help | ArcGIS Desktop, the following example exports each "Time Frame" as a unique file:
import arcpy import os mxd = arcpy.mapping.MapDocument(r"C:\Project\Project.mxd") df = arcpy.mapping.ListDataFrames(mxd, "Traffic Analysis") df.time.currentTime = df.time.startTime while df.time.currentTime <= df.time.endTime: # An example str(newTime) would be: "2008-12-29 02:19:59" # The following line splits the string at the space and takes the first # item in the resulting string. fileName = str(df.time.currentTime).split(" ") + ".png" arcpy.mapping.ExportToPNG(mxd, os.path.join(r"C:\Project\Output", fileName), df) df.time.currentTime = df.time.currentTime + df.time.timeStepInterval del mxd
p = arcpy.mp.ArcGISProject("CURRENT") m = p.listMaps("Yosemite National Park") for lyr in m.listLayers(): if lyr.supports("SHOWLABELS"): lblClasses = lyr.listLabelClasses()
as an example of how to access the map part, but I'm not seeing any documentation or examples on how to access the time property, if a Pro map has a time-enabled layer. In context, I'm working Working with a multidimensional raster layer—ArcGIS Pro | ArcGIS Desktop where I have some 100 rasters, each with a time stamp, and I want to export each "Step" as it's own JPEG.
Solved! Go to Solution.