Zoom to Selected feature, without using 'current' in ArcPy?

المشرف العام

Administrator
طاقم الإدارة
I am wondering if it is possible to build a zoom to geoprocessing service without using 'current' for the mxd variable in pyhton. Using 'current' my tool works in arcmap, but not in my gp service. here is my code that work fine locally in arc map

import arcpy MXD=arcpy.mapping.MapDocument('current') dataframe = arcpy.mapping.ListDataFrames(MXD, "Web Mercator")[0] dataframe.zoomToSelectedFeatures() arcpy.RefreshActiveView() whe I publish my service, the zoom feature no longer works. I have read online that you cant use 'current' in a gp service, thats fine. When I enter the path to the mxd, the zoom function no longer works?



أكثر...
 
أعلى