Skip to content

Instantly share code, notes, and snippets.

@toebR
Created November 15, 2023 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toebR/96dfb46a6f0e9154e7baff4fc986c767 to your computer and use it in GitHub Desktop.
Save toebR/96dfb46a6f0e9154e7baff4fc986c767 to your computer and use it in GitHub Desktop.
Zoom to Bookmark in an AGP Project
import arcpy
def ZoomToTargetBKMK(BookmarkNr):
aprx = arcpy.mp.ArcGISProject(r"CURRENT")
MapView = aprx.activeView
Map = MapView.map
TargetBkmk = Map.listBookmarks()[BookmarkNr]
print("Target bookmark: {}".format(TargetBkmk.name))
MapView.zoomToBookmark(TargetBkmk)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment