Book Image

Programming ArcGIS with Python Cookbook, Second Edition

By : Eric Pimpler
Book Image

Programming ArcGIS with Python Cookbook, Second Edition

By: Eric Pimpler

Overview of this book

The book kicks off with the fundamentals of starting to use Python with ArcGIS, followed by recipes on managing map documents and layers, including how to find and fix broken data links in these files. In the second part of the book, you will learn to create custom geoprocessing tools and how to use the Attribute and Location tools to select specific features. The third part of the book covers topics for advanced users including the REST API, and also teaches you how to use Python with ArcGIS Pro. The book finishes with appendices covering how to automate Python scripts, and the five things that should be at the back of every GIS programmer's mind.
Table of Contents (17 chapters)
16
Index

Assigning a unique name to layout elements

It's a good practice to assign a unique name to all your layout elements using ArcMap. This is important in the event that your geoprocessing scripts need to access a particular element to make changes. For example, you might need to update the icon that displays your corporate logo. Rather than making this change manually in all your map document files, you could write a geoprocessing script that updates all your map document files programmatically with the new logo. However, in order for this to be possible, a unique name will need to be assigned to your layout elements. This gives you the ability to access the elements of your layout individually.

Getting ready

As I mentioned in the previous recipe, each layout element will be one of a number of element types and each can be assigned a name. This element name can then be used when you need to reference a particular element in your Python script. You can use ArcMap to assign unique names to...