Does anyone know if ArcGIS Pro has Data Driven Pages capabilities yet? Also, would like to be able to customize layout properties of items and display for each map page using arcpy. I currently do this with a custom add-in for desktop, but would like to be able to move the process to pro. Would like to know if ESRI is planning to create their own add-in for Pro to achieve these types of functions. Any help would be appreciated. Thanks!
Message was edited by: Steve Ptak
Solved! Go to Solution.
Steve:
See this link:
UC Q&A | 2015 Esri User Conference
"ArcGIS Pro 1.2 is planned for release in Q4 2015. It will include:
Thanks Dan! The custom add-in we currently have uses Arcpy. I was curious if ESRI was planning on creating their own add-in for pro that allows this type of customization. (Thus retiring ours and avoiding any tweaks I may need to make)
Steve, Just fyi Python addin files are not going to be supported in Pro, from what I understand. I've been told this is mainly due to the "ribbon" format. However, The toolbox and many of the tools/scripts that you have written should work.....assuming they have the equivalent arcpy or tool supported in Pro. Of course this is not the case for all things (including data-driven, as Dan's link pointed out).
edit...oh, and I haven't messed with changing to the arcpy.mp yet myself.
Steve:
See this link:
UC Q&A | 2015 Esri User Conference
"ArcGIS Pro 1.2 is planned for release in Q4 2015. It will include:
Good stuff. Thanks!
Happy to help. I, too, am excited to see and work with version 1.2.
Hi Steve,
I have a script to create a Map Book that I made a few days ago with the help of Create a map book with Python—ArcGIS Pro | ArcGIS for Desktop . It modifies the text elements and map extent to act like they would with the data driven functionality. Hopefully this post points you or someone else reading this in the right direction if they don't want to wait until the next release. See the attached file for the PDF it outputs.
import arcpy, os
from arcpy import env
# Set input feature class to parameter
fc = arcpy.GetParameterAsText(0)
env.workspace = os.path.dirname(fc)
# Set output PDF location to parameter
pdfOutput = arcpy.GetParameterAsText(1)
# Create the PDF file
pdfPath = os.path.join(pdfOutput,'Inspection.pdf')
pdfDoc = arcpy.mp.PDFDocumentCreate(pdfPath)
# Assign project to parameter
project = arcpy.mp.ArcGISProject("D:\WebSeminars\ProTasks_Demos\Demo2\Data\BuildingTasks\BuildingTasks.aprx")
project.save()
# Select layout and assign to parameter
lyt = project.listLayouts("Layout")[0]
# Set map frame to a parameter and get an extent object
mf = lyt.listElements("MAPFRAME_ELEMENT", "Map Map Frame")[0]
# Set map to a parameter - when importing the layout, it imports the map that was saved with it (ensure this is set correctly)******
map = project.listMaps("Map")[0]
# Set asset layer to a parameter
lyr = map.listLayers(fc)[0]
# Assign Title, Location, Structure, Asset ID, Condition, Last Inspection, and Notes text elements to parameters
titleText = lyt.listElements("TEXT_ELEMENT","Title Text")[0]
locationText = lyt.listElements("TEXT_ELEMENT","Location Text")[0]
structureText = lyt.listElements("TEXT_ELEMENT","Structure Text")[0]
assetText = lyt.listElements("TEXT_ELEMENT","Asset ID Text")[0]
conditionText = lyt.listElements("TEXT_ELEMENT","Condition Text")[0]
lastInspectionText = lyt.listElements("TEXT_ELEMENT","Last Inspection Text")[0]
notesText = lyt.listElements("TEXT_ELEMENT","Notes Text")[0]
# Hide Location, Asset ID, Condition, and Last Inspection text elements for the title page
locationText.text = " "
structureText.text = " "
assetText.text = " "
conditionText.text = " "
lastInspectionText.text = " "
notesText.text = " "
# Zoom to extent of asset layer
###extent = mf.getLayerExtent (lyr,"False","True")
extent = mf.getLayerExtent(lyr)
mf.camera.setExtent(extent)
# Create Title Page for PDF
lyt.exportToPDF(os.path.join(pdfOutput,"TitlePage.pdf"))
pdfDoc.appendPages(os.path.join(pdfOutput,"TitlePage.pdf"))
# Add Length field and calculate values (maintain length in point feature class)
arcpy.AddField_management(fc,"Length","FLOAT")
arcpy.CalculateField_management(fc,"Length","!Shape_Length!","PYTHON")
# Copy selected features to in-memory workspace
arcpy.CopyFeatures_management(fc,"in_memory/SelectedAssets")
# Create center point of assets
arcpy.FeatureToPoint_management("in_memory/SelectedAssets","in_memory/AssetCentroid","CENTROID")
notesText.text = "Notes: _________________________________________________________________________"
# Loop through selected records and create map book
with arcpy.da.SearchCursor("in_memory/AssetCentroid", ['AssetID','CONDITION','LastInspection','DESCRIPTIO','Length','SHAPE@XY','STRUCTURE1']) as cursor:
for row in cursor:
# Get x and y values of centroid
x, y = row[5]
# Set different map extents for different sized features
if row[4] < 70:
# Set smaller extent
left = x - 166
right = x + 166
top = y + 131
bottom = y - 131
else:
# Set larger extent
left = x - 494
right = x + 494
top = y + 390
bottom = y - 390
# Create string from Condition domain value
if str(row[1]) == '1':
conditionValue = 'Bad'
elif str(row[1]) == '2':
conditionValue = 'Poor'
elif str(row[1]) == '3':
conditionValue = 'Fair'
elif str(row[1]) == '4':
conditionValue = 'Good'
elif str(row[1]) == '5':
conditionValue = 'Very Good'
# Update Title, Condition, and Last Inspection text elements
titleText.text = " "
locationText.text = "Location: " + str(row[3])
structureText.text = "Structure: " + str(row[6])
assetText.text = "Asset ID: " + str(row[0])
conditionText.text = "Condition: " + conditionValue
lastInspectionText.text = "Last Inspection Date: " + str(row[2])
# Update map frame extent to the current asset feature
# Assign extent values to parameter
desc = arcpy. Describe(fc)
sr = desc.spatialReference
# Assign extent object new values
extent.XMin = left
extent.XMax = right
extent.YMax = top
extent.YMin = bottom
mf.camera.setExtent(extent)
# Append pages to the PDF
lyt.exportToPDF(os.path.join(pdfOutput,"Asset" + str(row[0]) + ".pdf"))
pdfDoc.appendPages(os.path.join(pdfOutput,"Asset" + str(row[0]) + ".pdf"))
# Set document properties – Change pdf_author to your name or the name of your organization
pdfDoc.updateDocProperties(pdf_title = "Asset Inspection",
pdf_author = "Esri Canada",
pdf_subject = "Asset Inspection",
pdf_keywords = "inspection; asset; condition; last inspection",
pdf_open_view = "USE_THUMBS",
pdf_layout = "SINGLE_PAGE")
pdfDoc.saveAndClose()
Thank you Jennifer! I'll try this out in the coming weeks.