New answers tagged arcpy-mapping
Insert arcpy.RefreshActiveView() in your script before testing for legend overlap.
There is not a way in arcpy.mapping to directly do the graphics conversion that you want. One way to maybe pull this off, though, is to create a second map document from the web map and then modify that map document so that its layout consists only of the legend with the format and dimensions you want. One easy way to achieve this is to set the ...
The problem here is that this is a script tool. "Testing1" is added to your map document because it is the output of the scripting tool and you have ArcGIS Desktop configured to add script tool output to the map. The script itself does not add your output to the map. Because of this, when you read line 176 and try to access the "Testing1" layer, it does ...
As far as I know there is no lifecycle or anything else. Usually this happens if the create function is not totally finished. EDIT: see correct answer from @blord-castillo 1st try Maybe a refresh of the catalog just before the arcpy.SelectLayerByAttribute_management() helps: # Refresh the Catalog window for the new directory ...
import arcpy, os import arcpy.mapping PATH = r"D:\test" ## Path with the mxds arcpy.env.workspace = PATH arcpy.env.overwriteOutput=True listMXD = arcpy.ListFiles("*.mxd") for item in listMXD: mxd = arcpy.mapping.MapDocument(os.path.join(PATH, item)) outjpg = item[:-4] + ".jpj" arcpy.mapping.ExportToJPEG(mxd, outjpg, resolution=300 ) del mxd
Top 50 recent answers are included