[GIS] Can you use active layer as input for dynamic text

arcgis-10.0arcgis-desktoparcmapdynamic-text

I'm wondering if you can lift the name of a layer in the ToC (within a group) and use it in dynamic text.

Is there existing syntax to do this?
Perhaps …

<dyn type="ToC" property="activeLayer"/>

Using ArcMap 10 sp3.

Best Answer

I use a workaround that has functioned fairly well. I use MXDs to prepare multiple printable maps (in a single MXD) frequently. Typically I'm showing the same bookmark/extent and have consistent background data, BUT want to swap out and highlight specific features in differently named maps. To create a fake dynamic title I add a separate Legend from the one I use to show actual symbology, and just show the Layer Name text. Here are my steps:

  1. Add dummy shapefile/feature class (ex. - I use the county boundary of a single county, or the single largest geography I happen to be working with)
  2. Make the symbology of the dummy file no color with no outline
  3. Add Layer Name/ Heading info that is appropriate for your 'dynamic text' - in my case it will represent the figure number/ title
  4. Add a new Legend that will ONLY contain dummy files (aka your title/dynamic text)
  5. Add your dummy files to the new Legend
  6. To keep text alignment reasonable, make the default patch size 0.000001 ( or some small number) - you will not be allowed to make the patch size exactly 0
  7. In the General Legend tab make sure to 'Only display layers that are checked in the TOC' and it helps to uncheck the 'Add new item to the legend when a new layer is added to the map'

I created several MXDs where I used this technique not only to display a 'dynamic title', but also dynamic text such as the 'data source' and 'map prepared by' information. For each of the fake dynamic text features, I utilized a dummy shapefile (no fill/ no outline) and grouped that dummy with any relevant shapefiles/symbology intended for an individual printable map. The MXD can get very large and can get clunky, but you're ensured that basemap data ALWAYS looks the same (you don't have to modify labels/symbology in many MXDs that show the same overall viewport, because it's all saved in a single MXD).

Related Question