4

Sometimes I'll have a MXD set up as a mapbook using Data Driven Pages, but I'd like to display certain pages at a different scale than others in the same mapbook. I can do that using the Data Driven Scale option in Data Driven Pages, but when those pages are viewed or rendered, the scale bar uses the same units and divisions (for example, two 1000-foot sections) for all pages and is simply stretched or compressed to correctly match the display scale of each page. So if I have a mapbook where most pages are 1:12000, and one page is 1:6000, that one page will have a scale bar that is twice as long as the other pages, because ArcGIS is using the same settings (division units, division value) for the scale bar on every page.

Is there a way to change this, so that I can set the scale bar parameters independently for each page?

For example, if I go from a scale of 1:24000 to 1:10000, I might want to use increments of 0.25 miles and 500 feet respectively.

Currently what I'll do if I have, let's say, an 80-page mapbook with a few pages at a different scale than the rest, I'll render the majority of the pages first, then change the scale bar settings manually for the few pages that would look better with a different scale bar. But if someone comes along and opens the MXD after me and tries to render the same mapbook, they may not take that step and the scale bars will not be right.

  • 2
    not an answer, just a thought: I don't think what you're asking is directly possible, but maybe you could try something with a second, empty data frame, which only has a scale bar set up in the units/style you want?? like i said, just a thought – Adam Nov 10 '15 at 23:09
  • 3
    I like @Adam's idea. However, I don't think you'll need a second data frame. But, perhaps you could have a second or third scale bar. One for each unit that you want to display and give them a unique name. Using python, you can move the scale bar off the page and move the other one back onto the page. – Fezter Nov 10 '15 at 23:37
  • This question is about scale bar intervals rather than grids/graticules but I think it is in the vicinity of gis.stackexchange.com/questions/23375/… Getting more control over grids/graticules intervals during map automation is one of my biggest bug bears. – PolyGeo Nov 10 '15 at 23:48
3

I don't think you can change the properties of the scale bar using the out-of-the-box Data Driven Pages functionality.

However, that is not to say that what you're looking to do is impossible.

It wouldn't be terribly difficult to do this using ArcPy and is roughly described in this [ESRI Help Page][1]. Using their example, you could set up multiple scale bars, one for each setting you prefer, and then move them on and off the page based on scale of a given data-driven page.

To get it to work you would have to bypass the normal data-driven pages export and loop through the pages using Python and the above example.

Something along these lines (I HAVE NOT TESTED THIS, YOU WILL HAVE TO ADAPT IT TO YOUR DOCUMENT):

#You're going to need to reference your current map document and the data frame, assuming you just have one 
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]

#Associate scale bars in your layout with variables that arcpy can manipulate
m_scale = arcpy.mapping.ListLayoutElements(mxd, "MAPSURROUND_ELEMENT", "m scale bar")[0]
km_scale = arcpy.mapping.ListLayoutElements(mxd, "MAPSURROUND_ELEMENT", "km scale bar")[0]

#Iterate through all the pages, for each page, look at the scale, then adjust the scale bars to be on, or off, the page.
for page in range(1, mxd.dataDrivenPages.pageCount +1):

    #Check the scale and move the elements around to get the right scale bar on the page
    if df.scale < 25000:
        m_scale.elementPositionX = 5 #on the page
        km_scale.elementPostitionX = 15 #off the page

        #Export the current page to a pdf, using a specified path
        arcpy.mapping.ExportToPDF(mxd, r"C:\Project\Output\Project1.pdf", df)
    else:
        m_scale.elementPositionX = 15 #off the page
        km_scale.elementPostitionX = 5 #on the page

        #Export the current page to a pdf, using a specified path
        arcpy.mapping.ExportToPDF(mxd, r"C:\Project\Output\Project1.pdf", df)
    mxd.dataDrivenPages.refresh()
  • Thanks! That helps, using arcpy to move a few different scale bars in and out of the layout occurred to me but I didn't know how to go about it. I'd still like to see if there's a GUI solution, I'm trying to make it so that if someone needs to make a revision to one of these mapbooks and I'm not around, they can export it without needing a script. But that may not be possible.. – Dan C Nov 11 '15 at 1:25
1

I just did something like this in ArcMap 10.5. In the DDP setup dialogue under "Exent," select the option for Data Driven Scale. This option allows you to pull the scale from an attribute field. Then set up your scale bar in the desired format (for me, this was with a division value of 0.5mi, 2 subdivisions and Resizing option of adjust number of divisions - default is to adjust the width aka length). Now, when I scroll through the DDP in my MXD, the scale bar changes as well but remains the same size from map to map.

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.