ArcGIS Pro 2.9.2 on Dell laptop running Windows 10.
I have a project opened and I want to use Python to change the active map.
For this example, I have two maps in my ArcGISProject. Currently "Map A" is my active map, but when I run some geoprocessing tools, via python window, the output will be added to "Map A", but I want the output to be added to "B Map".
Can I switch my active map with Python? Or how do I direct the output to a specific map? The arcpy.env does not seem to cover "maps".
import arcpy
aprx = arcpy.mp.ArcGISProject('current')
map1 = aprx.listMaps("Map A")[0]
map2 = aprx.listMaps("B Map")[0]
Thanks for you help.
-John
Is the project open and you are using a notebook or the python window?
tool in arctoolbox
What circumstances would you need to add data to a map that isn't open instead of the one that is?