Can script using arcpy.mapping.MoveLayer() be made to run faster?

المشرف العام

Administrator
طاقم الإدارة
We're running ArcGIS 10.0 and using a python script to move layers, turn on the correct layers, zoom to the correct extent and export a pdf map. The script normally takes 30 - 35 seconds to finish. Moving layers takes the bulk of the processing time, usually 20 - 25 seconds using this code:

for y in arcpy.mapping.ListLayers(mxd): move_lyr = arcpy.mapping.Layer('Available Zips')refLayer = move_lyrfor lyr in arcpy.mapping.ListLayers(mxd): if lyr.name == zip_view: zip_move = lyrfor lyr in arcpy.mapping.ListLayers(mxd): if lyr.name == zip_view: arcpy.mapping.MoveLayer(df, refLayer, zip_move, "BEFORE")Is there a way to optimize this code to run faster?



أكثر...
 
أعلى