1. 程式人生 > >arcpy啟用圖層時間屬性

arcpy啟用圖層時間屬性

import arcpy.mapping as mapping, os
mxd = mapping.MapDocument("CURRENT")
df = mapping.ListDataFrames(mxd, "Crime")[0]
dft = df.time
dft.currentTime = dft.startTime

while dft.currentTime <= dft.endTime:
    fileName = str(dft.currentTime).split(" ")[0] + ".pdf"
    mapping.ExportToPDF(mxd,os.path.join(r"C:\ArcpyBook\Ch2", fileName))
    print("Exported " + fileName)
    dft.currentTime = dft.currentTime + dft.timeStepInterval