ArcGIS, Edit Layer Extents with Python script

المشرف العام

Administrator
طاقم الإدارة
I would like to read and edit the Extent Values of each Layer in a MXD-file.

My code:

import arcpymxd = arcpy.mapping.MapDocument(r"D:\Work\myInFile.mxd")for lyr in arcpy.mapping.ListLayers(mxd): if lyr.isFeatureLayer: # read print lyr.getExtent # write lyr.getExtent = ({XMin}, {YMin}, {XMax}, {YMax})mxd.saveACopy(r"D:\Work\myOutFile.mxd")del mxdThe getExtent method is described here But I'm not sure whether this is in any way the correct method.



أكثر...
 
أعلى