0

I have been trying to extract a list of all the layers in my mxd (Arc9.3.1), using Python 2.5. If I could have the source of the layers too that would be even better... But as long as I can get a list of all the layers I have in my mxd that would be so handy!

I have seen several scripts but they are all "arcpy" , which as far as I understood only Arc10, unfortunately upgrading is not possible right now. there is very little on 9.3.1.

I am a somehow new to Python but I am confident we will find a work around for that.

Thank you so much for you help!

2

The functionality to list layers in an MXD only became available with the introduction of the ArcPy site-package and its arcpy.mapping module at ArcGIS Desktop 10.0.

Using arcgisscripting to list datasets at ArcGIS Desktop 9.3.1 was straightforward but the Python offerings for ArcGIS needed significant development before layers would become understandable to them as well.

If meeting this requirement is mandatory then your only option is to upgrade to at least ArcGIS Desktop 10.0.

  • sorry, so how do I use the list datasets from ArcGIS Desktop? Should I use webhelp.esri.com/ARCGISDESKTOP/9.3/… and use MXD instead of CAD ? in the example? Thanks one more time – user24721 Dec 9 '13 at 4:45
  • Change "CAD" to either "Feature" or "All" as per the help documentation. – Fezter Dec 9 '13 at 5:34
  • @user24721 I am not sure that you are appreciating the difference between a dataset and a layer - it could be worth reading this Q&A. What you are trying to do cannot be done using Python at ArcGIS 9.x. – PolyGeo Dec 9 '13 at 5:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.