mxd = arcpy.mapping.MapDocument(r"C:\Maps\MakeMaps.mxd") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] #df name is "Layers" in this example for lyr in arcpy.mapping.ListLayers(mxd): lyr.visible = True ext = lyr.getExtent() df.extent = ext arcpy.mapping.ExportToPNG(mxd, r"C:\Maps\Exports\" + lyr + ".png")
Use export to png:http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000002s000000this thread will help you, be sure and read the last thread:http://forums.arcgis.com/threads/17136-Turn-layers-off-w-arcpy.mappingYou will also need to set the extent inside the loop (you will need to save and close the mxd with all layers turned off):I have not tested this so you might have to tinker with it. mxd = arcpy.mapping.MapDocument(r"C:\Maps\MakeMaps.mxd") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] #df name is "Layers" in this example for lyr in arcpy.mapping.ListLayers(mxd): lyr.visible = True ext = lyr.getExtent() df.extent = ext arcpy.mapping.ExportToPNG(mxd, r"C:\Maps\Exports\" + lyr + ".png")
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.