A simple yet powerful method in ArcPy is missing: opening/activating an existing map.
It is possible to add a new map (newMap = aprx.createMap("Map")) and it is also possible to get the (last) active maps (aprx = arcpy.mp.ArcGISProject("current") //active_map = aprx.activeMap).
What's missing is a method to not only replace the "activeMap" in the code, but also to open/activate that map, so that it is displayed in the map view window. To activate a map in the code it would need a method like "Mapname.activate()" which overwrites the previous"activeMap". Since normally the active map is the last used map in the map view window (the big part in the middle of the screen), the anticipated method "activate()" would also need to add that activated map.
I could think of many cases where this method could be used.
@nadja Have you tried:
Map.openView()? It opens a view for the map objects AND activates it. This works for Layout and Reports too.
We also have ArcGISProject.closeViews()
Jeff - Layout and arcpy.mp teams
@JeffBarrette no - thank you, that's exactly what I meant 🙂 I leave the idea, in case anyone else has trouble finding the documentation...
Map.openView() was what needed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.