Note that there are some explanatory texts on larger screens.

plurals
  1. POAutomating capture of Extent from multiple mxds with multiple dataframes
    primarykey
    data
    text
    <p>I want to create a single shape file from multiple mxd's that have multiple frame sets with different extents in them. I have found/started a python script to do this (code below) but can't figure out how to write the captured X&amp;Y Max/Min into the shape file that is created for this. See output below - an Attribute Error is generated. </p> <p>I also want it to write the scale and title of the frame as well as the file name of the mxd in to the extents shape file.</p> <p>Would appreciate your help in completing this script.</p> <p>Thanks,</p> <p>George</p> <p>--- CODE START</p> <pre><code>import arcpy, os, glob path = 'P:\\2011\\Job_031_TownPlanning_SeriesProduction\\Working\\mxd\\1' os.chdir(path) mxds_List = glob.glob('*.mxd') mxd2 = glob.glob('*.shp') count_Mapdocs = len(mxds_List) print 'Processing ' + str(count_Mapdocs) + 'map documents...' #Create Polygon Shapefile arcpy.CreateFeatureclass_management(path, 'extents.shp', "POLYGON") arcpy.CreateFeatureclass_management(path, 'mxds.shp', "POLYGON") #Start Loop for mxd2 in mxds_List: mapDoc = arcpy.mapping.MapDocument(mxd) dataframe = arcpy.mapping.ListDataFrames(mapDoc,'*')[0] frameExtent = dataframe.extent #Frame Scale frameScale = dataframe.scale #Frame Extent ExtentXMax = frameExtent.XMax ExtentXMin = frameExtent.XMin ExtentYXax = frameExtent.YMax ExtentYMin = frameExtent.YMin point_object = mxd2.shp #Write in table scale #Write in table </code></pre> <p>--- END CODE</p> <p>--- OUTPUT START</p> <blockquote> <blockquote> <blockquote> <p>Processing 14map documents... Traceback (most recent call last): File "P:\2011\Job_031_TownPlanning_SeriesProduction\Working\extent.py", line 31, in point_object = mxd2.shp AttributeError: 'str' object has no attribute 'shp'</p> </blockquote> </blockquote> </blockquote> <p>--- END OUTPUT</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload