I had a successful script that was working great. I did some rearranging and polish on the map now I get no layers on my PNG except PNG. The Base Layer is there the text boxes update just fine. So I stopped the loop and the export and just ran it to the save and the map is updated just fine and when I open it in Arcmap everything is updated correctly. its only when i got to export via Python I get just a base layer, text boxes and pictures no layers. Has anyone ran into something similar or have any insight.
for step in hourdriver: for lyr2 in arcpy.mapping.ListLayers(mxd,"CR"): lyr2.definitionQuery = coronerquery+"".join(str(step)) print lyr2.definitionQuery # added for diag for lyr in arcpy.mapping.ListLayers(mxd,"TA"): lyr.definitionQuery = trafficquery+"".join(str(step)) print lyr.definitionQuery # added for diag for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"): if elm.name == "TIME_DESC": print "Found it" elm.text = timelist[step] print elm.text filename = outputfolder+"".join(str(step))+""".png""" print filename mxd.save() arcpy.mapping.ExportToPNG(mxd,filename)
Lyr and Lyr2 both update on the map and save but but do not show up in the PNG....
As i write this i was thinking that both layers are coming from the same SQL server could there be a hang up there?
Thank you in advance for your time.