How to extent of the map view as an image format in arcgis pro to the same size as polygon's feature class?
From converting this code
import arcpy, os
aprx = arcpy.mp.ArcGISProject("CURRENT")
mv = aprx.activeView
# Change the extent of the map view
ext = mv.camera.getExtent()
ext.XMin = ext.XMin
ext.YMin = ext.YMin
ext.XMax = ext.XMax
ext.YMax = ext.YMax
mv.camera.setExtent(ext)
Output_File = os.path.join(arcpy.env.scratchFolder, 'ActiveMapView3.png')
mv.exportToPNG(Output_File, width=1000, height=1000)