AnsweredAssumed Answered

Export Map (Data Frame) to JPEG

Question asked by geonetadmin on Feb 11, 2013
Latest reply on Jul 17, 2013 by geonetadmin
Original User: Playa

I have an Index Feature Class that I want to use to export my CURRENT Data Frame to JPEG. I want to loop through each row within the Index Feature Class and for each row select the feature and use it to set the Current Extent and Scale and export the Data Frame to JPEG using the name of the selected feature (i.e. 3318BD07) I've attached my code so far, but its not passing the current row as new selection. Any assistance to update my code to accomplish the following will be appreciated.

>>> import arcpy,os
>>> mxd = arcpy.mapping.MapDocument("CURRENT")
>>> df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]
>>> index10k = arcpy.mapping.ListLayers(mxd, "Index10k_wgs84",df)[0]
>>> rows = arcpy.SearchCursor(index10k,"","","TAG","")
>>> for row in rows:
...     df.extent = index10k.getSelectedExtent(False)
...     df.scale = df.scale*1.1
...     arcpy.mapping.ExportToJPEG(mxd, os.path.join(r'S:\Projects\01_Rebieeck_West\jpeg',row.getValue("TAG)+".jpg"),df)