I have coordinates from a point that I want to move to. I typically use the zoom to x,y on arc desktop but I am trying to automate the process using arcpy. I can't seem to figure out how to use the coordinates to move the extent with the point in the middle and then a scale at 50000.
What is your script? and are you using arcpy mxd with 'CURRENT' in the mapping module? and does it include a refresh?
The basics are covered here: arcgis desktop - Using ArcPy to zoom to Y,X (string) coordinate pair copy/pasted from Google Maps? -...
x,y = # tuple containing x,y coordinates
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
df.panToExtent(arcpy.Extent(x,y,x,y))
df.scale = 5000
arcpy.RefreshActiveView()
Extent—Help | ArcGIS Desktop doesn't work with spatial references directly so you will want to make sure the coordinates you are passing are already in the same coordinate system of the data frame.
Is there anything like it the arcpy that ships with Pro? It's certainly not in...
arcpy.mp
Looks like it may now be handled using the Camera—ArcPy | ArcGIS Desktop and
mf.camera.setExtent(<extent>)
or
mf.camera.getExtent()
Arne Gelfert This link provides some explanations and the diagram shows the inter-relationships and what has moved and where.
Migrating from arcpy.mapping to ArcGIS Pro—ArcPy | ArcGIS Desktop
Thanks, Dan... I'll check it out. Camera.extent was a good start. Even easier, it appears, will be to just use camera.X/camera.Y.