What I'm currently working on: approximately 20 historical topographic maps of a specific area spanning 70 years.
What I'd like to do: instead of saving each historical topo as a different file, I would like to just enable each layer (in this case rasters .tif) and print or export to pdf.
For example the particular text in question would say 1938 HISTORICAL TOPOGRAPHIC MAP or 1940 HISTORICAL TOPOGRAPHIC MAP which corresponds to the layer name.
I don't think Data Driven pages applies here since I'm using the same extent (please correct me if I'm wrong).
It would appear that maybe a python script is the best way to go and I found this one here by https://gis.stackexchange.com/users/1608/artwork21.
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] # default Layers dataframe
for lyr in arcpy.mapping.ListLayers(mxd, "*", df):
if lyr.visible == True:
for elm in arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT"):
if elm.text == 'Text': # whatever your text element is named here
elm.text = lyr.name
break
However, it's been years since I used python and I'm not sure how to implement this code in ArcPy.
No comments:
Post a Comment