Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5983653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:15:42+00:00 2026-05-22T22:15:42+00:00

I want to create a single shape file from multiple mxd’s that have multiple

  • 0

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&Y Max/Min into the shape file that is created for this. See output below – an Attribute Error is generated.

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.

Would appreciate your help in completing this script.

Thanks,

George

— CODE START

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 

— END CODE

— OUTPUT START

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’

— END OUTPUT

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T22:15:43+00:00Added an answer on May 22, 2026 at 10:15 pm

    First you define mxd2 as a list of .shp files, then you clobber it by using it as the value for the mxds_List loop, which turns mxd2 into a series of string values. By the time point_object is assigned, mxd2 is a string object which does not have an “shp” attribute. You probably want “for mxd in mxds_List” to be compatible with the mapDoc assignment line that follows. I don’t know what the correct assignment for point_object is, but if it’s supposed to be a file form the mxd2 list, you need a way to iterate through mxd2 as you go through mxds_List. If there is one .shp for each .mxd file, you could use a range of integers to have a common index for both lists.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want a small (< 30MB) standalone Windows executable (a single file) that creates
I want to create an app that has multiple animations on the screen AT
I want to create a function that performs a function passed by parameter on
I want to create a simple http proxy server that does some very basic
I want to create a number of masked edit extenders from codebehind. Something like:
I want to create an application where I'll create an image from the application
I want to create the app modular and would like to create multiple EDMX,
I want to create a flat result set from the results of two methods
I want create a drop shadow around the canvas component in flex. Technically speaking
I want to create a Java application bundle for Mac without using Mac. According

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.