0

I have a map series of 30+ data driven pages that I am altering the layout of, trying to do as much of it with ArcPy as possible to save time. I need to change the symbology of the Extent Indicator.

Can this be coded?

enter image description here

Original: enter image description here Desired: enter image description here

JMVDA
  • 389
  • 2
  • 15
  • 1
    The setup you have there should change the extent indicator in your Global Indicator frame for each page in Layers as it is refreshed, is it not doing this? You may need to call refreshActiveView https://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-functions/refreshactiveview.htm to get the page to update first. – Michael Stimson Jan 10 '20 at 01:58
  • I know how to do change the Extent Indicator manually (and have it show up correctly), I want to change it with Arcpy so that I don't have to manually change it on 40+ maps. – JMVDA Jan 10 '20 at 13:11
  • 1
    If you are using data driven pages the extent indicator should change automatically when the data driven page changes.. if you were to export a map series you should expect that the extent indicator is congruent with the 'layers' data frame unless you have converted your extent indicator to a graphic which will no longer change as converting map surround items to graphics changes them from auto changing to fixed. – Michael Stimson Jan 12 '20 at 23:54
  • I am using Data Driven pages and the actual extent is updating properly. This is not the problem. I want to change how it looks like. See edit above. – JMVDA Jan 14 '20 at 16:12
  • Not sure if it's what you're trying to do, but it seem that it could be done by duplicating one of your layer and using the "Page Definition Query" that appear next to the definition query on the definition query tab of layer property when you use the data driven page – J.R Jan 14 '20 at 16:48
  • That kind of interface is beyond the scope of the arcpy API, to change the symbol of a locator frame you will need to use ArcObjects though looking at it (ILocatorRectangle2.Border as ISymbolBorder) has only LineSymbol as ILineSymbol property, no filling! I suggest you try the approach mentioned by @J.R - I've used this method to create filled polygons in locator frames in DS MapBook, the precursor to data driven pages, this method can be coded in python by accessing layer definitionQuery https://resources.arcgis.com/en/help/main/10.2/index.html#/Layer/00s300000008000000/. – Michael Stimson Jan 14 '20 at 23:51
  • @MichaelStimson - I have also concluded that it cannot be done and have resigned myself to just doing it manually as I don't really want to add extra thinks to the mxd that someone else won't understand. If you move your comment to an answer, I'll accept it. – JMVDA Jan 15 '20 at 15:01

1 Answers1

1

Python is really handy for the casual user but its scope is limited, ArcObjects offers a much bigger scope for modification and can need external software. As we've seen in the comments there are some things that even ArcObjects can't do.

The limited scope of python is one of its strong points, not having to search through thousands of interfaces, classes, enumerators and properties keeps the arcpy environment less daunting; it also helps that python is fairly close to natural speaking and is considered to be in the cusp of a 4GL. The downside is that as users progress into more advanced concepts they very quickly hit a 'brick wall' with python being unable to do what they want.

There are ways to access ArcObjects from python but you will run into one of the least friendly help docs trying to get any kind of clarity; I say this because unless you know the name of the interface you're after in advance you wont find any help but starting with the example code provided with the ArcObjects API a user with a good knowledge of VB.net, C# or C++ can self-learn very quickly but if you don't already know one (or more) of these languages the samples don't help at all with python.

In this particular instance you're trying to alter a locator rectangle as ILocatorRectangle2 which has a property of Border as IBorder that implements ISymbolBorder with a property LineSymbol as ILineSymbol and does not implement IFillSymbol, which is where you would be able to modify the fill properties as well as the outline of the intended symbol... in short the only option for a locator rectangle is an outline except if you abandon the locator entirely and use a page definition query on a layer in the 2nd map to turn on/off certain polygons whose style is able to be set normally as J.R indicated in their comment.

Michael Stimson
  • 25,566
  • 2
  • 35
  • 74