Solved! Go to Solution.
I am using data driven pages to generate a map book of 507 utility districts in our county. I want to select the current feature on the map page so that it is highlighted in the exported .pdf. With the .mxd open, the base python code I am using is:
mxd = arcpy.mapping.MapDocument("CURRENT")
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
# Select current feature ?
print "Exporting page {0} of {1}".format(str(mxd.dataDrivenPages.currentPageID), str(mxd.dataDrivenPages.pageCount))
arcpy.mapping.ExportToPDF(mxd, r"D:\PCMElee\Utilities\RouteBooks\MapBook_PCU_RouteBooks\RouteBook_Page" + str(pageNum) + ".pdf")
I have looked at a number of posts and the help. So far I not found a way to approach the problem with ArcInfo 10.0
Thank you in advance for your help and direction on this.
You are not very explicity on what the selected feature is. I assume you mean the page in an index layer in a location map inset?
In the index dataframe copy the layer that is being used for data driven pages.
The first layer will be an outline say Index.
The second layer (renamed say Sheet) will be the highlighted tile. Set this layer to be a filled colour.
With data driven pages enabled, open the properties>definition and you will see two button options instead of one, Query Builder or Page Definition. Select the page definition button and choose your options. Set the pages field and set Features that Match.
If it is not the index that you want highlighted, the process is the same with any other feature layer, add a field so that the feature(s) to be highlighted has the pagename that corresponds in the attributes.
I am using data driven pages to generate a map book of 507 utility districts in our county. I want to select the current feature on the map page so that it is highlighted in the exported .pdf. With the .mxd open, the base python code I am using is:
mxd = arcpy.mapping.MapDocument("CURRENT")
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
# Select current feature ?
print "Exporting page {0} of {1}".format(str(mxd.dataDrivenPages.currentPageID), str(mxd.dataDrivenPages.pageCount))
arcpy.mapping.ExportToPDF(mxd, r"D:\PCMElee\Utilities\RouteBooks\MapBook_PCU_RouteBooks\RouteBook_Page" + str(pageNum) + ".pdf")
I have looked at a number of posts and the help. So far I not found a way to approach the problem with ArcInfo 10.0
Thank you in advance for your help and direction on this.