Can you solve this?

1014
5
02-20-2017 03:09 PM
Jean-SimonLevert
New Contributor II

I have

x :  -73,512864

and

y:  45,659871

 

What is the code i need to put in ArcGIS Pro (Python3) to go to that GPS place and to zoom it at 1:5 000?

 

Put your codes lines here  (I tried everything and im not able to find any way.)

Tags (2)
0 Kudos
5 Replies
DarrenWiens2
MVP Honored Contributor

If you've tried everything, how can we help?

Share your best guess and we can go from there.

DanPatterson_Retired
MVP Emeritus

I think there is a need for code... previous link

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

Looks like you can use the Locate tool to get you there. Look at this thread Is there a Go to X Y tool, or similar in ArcGIS Pro ? 

Zooming to 1:5000 I'm not sure

edit: for the python side of things, this may be a good starting place

Add Locations—ArcGIS Pro | ArcGIS Desktop 

0 Kudos
Jean-SimonLevert
New Contributor II

-----------------------------------------------------

import arcpy
aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.listMaps()[0]
lyr = m.listLayers()[0]
lyt = aprx.listLayouts()[0]
mf = lyt.listElements()[0]
mf.camera.setExtent(mf.getLayerExtent(lyr, False, True))

-----------------------------------------------------

I found that this will zoom out until i see everything.

Im still looking for a way to get to x : -73,512864 and y: 45,659871 and to zoom to 1:5 000.

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

This seems to be a duplicate post??

See Joshua Bixby‌ response https://community.esri.com/message/668014-re-zoom-in-at-15-000-at-x-73512864-and-y-45659871 

Also, I'm not sure how to set in Pro, but make sure it knows your separator is a "," comma and not a "." dot  (localization?)