2

This question appears on many sites and I was wondering if there was a script that is now available that resolves it?

Please also upvote the ArcGIS Idea that Reference grids/graticules should be accessible to arcpy.mapping.

My workarounds have been to create multiple mxd's that just hold the same scale map sets and then export only the relevant pages to that scale but this adds a lot of time to the process when changes are required as they have to be done on each mxd.

The other related issue is with the centering of elements where when a map is 1:10000 and another is 1:100000 one of them will be off centered from other elements such as the "N" Arrow.

1

I workaround this major ArcPy issue by keeping a "master" MXD that I then "clone" using a script to create "master"_1deg, "master"_30min, "master"_10min, ... , and "master"_1sec MXDs. For each of these I then need to manually set the interval on the graticule.

Then within my script, once I have opened the "master" MXD (or any MXD) and used it to determine the extent, which is usually by zooming to a particular feature), I use the extent width (and/or height) to determine the appropriate "master"_"interval" MXD to open instead. I then use that to perhaps ExportToPDF with an appropriate interval.

The workaround works but is far from ideal because everytime a modification is made to the "master" MXD that cannot be propagated through to its clones via a script, it means that it will have to be recloned and have the graticules of all the clones reset.


ArcGIS Pro 2.4 appears to offer a solution to this. I have not yet tested it but it is described at https://community.esri.com/ideas/3431-reference-gridsgraticules-should-be-accessible-to-arcpymapping#comment-75197 and involves using Python CIM access to provide finer-grained access to more settings/capabilities.

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.