Skip to content

Instantly share code, notes, and snippets.

@green3g
Created June 12, 2017 14:31
Show Gist options
  • Save green3g/b8d75c0001aa932526412dbadac7d45c to your computer and use it in GitHub Desktop.
Save green3g/b8d75c0001aa932526412dbadac7d45c to your computer and use it in GitHub Desktop.
ArcGIS Project Map Parameter
def updateParameters(self):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parameter
has been changed."""
if self.params[0].altered and self.params[0].value != "":
projectPath = self.params[0].value
aprx = arcpy.mp.ArcGISProject(projectPath)
# Get list of maps in project
map_list = [m.name for m in aprx.listMaps()]
# Populate Map param
self.params[1].filter.list = map_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment