I'm writing code to create new ArcGIS Pro Projects using the Pro arcpy (package arcpy.mp)
Doing something like this:
import arcpy.mp
aprx = arcpy.mp.ArcGISProject(r"C:\temp\Empty.aprx")
map = aprx.listMaps()[0]
map.map.addDataFromPath(r"C:\Users\xxxxxx\Documents\Test1\Orthomosaic.tif")
aprx.saveACopy(r"C:\temp\jNew.aprx")
But I can't figure out to zoom the map to the extent of Orthomosaic.tif (or any other extent for that matter).
From the docs at Alphabetical list of arcpy.mp classes—ArcPy | ArcGIS Desktop
I can see that a MapFrame has a zoomToAllLayers method, but a MapFrame is only available on a Layout element.
Anyone know how to do this?
Thanks.