I need to add zoom to a point in a feature class I just added it to. But I don't necessarily have a layout at this point. I was able to do this in arcmap.

I looked like I could zoom to selected but no. here is what I tried so far.

curMDX = arcpy.mp.ArcGISProject("d:\pathto aprx file")

def pantoselected(curMDX,SelectFC):

            inputstr = "same string that is in in Coordstr because I just added it to the FC"

            Expression = "{0} = '{1}'".format("Coordstr", inputstr)

            dataFrame = curMDX.listMaps()[0]

            lyr = dataFrame.listLayers(SelectFC)

            #  Works to here

            # by the way this works just fine in arcmap10.4

            arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", expression)

            zoomToAllLayers ({

apparently there is no answer. ESRI has decided that those kinds of features are only going to be available to developers that buy the SDK. That mean all of the users are SOL that need to simple things like zooming to a point. On the other hand QGIS is free and this kind of tool is simple.

|improve this answer|||||
  • You can manually adjust the dataframe extent to center on your point and adjust the scale – mikewatt Dec 19 '19 at 1:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.