Blank PNG export

4746
10
Jump to solution
05-04-2015 05:41 PM
KendrickSchuett
New Contributor II

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.

0 Kudos
10 Replies
KendrickSchuett
New Contributor II

well just to clarify the problem was me I think, Anaconda had a newer numpy then ARCpy and I thought to my self well i can't have an older LIB anywhere.... I first started using anaconda for my mapping Py and I got an error that said " this was compiled for numpy 6 you are using numpy 9. so i thought to my self oh i need to get rid of the numpy 6 in Arcpy and that will fix it.... so i did.... then a couple days later I run my old script and noticed the problem. As with many things this was a me problem I think. 

0 Kudos