Select to view content in your preferred language

Map Properties Arcpy

688
2
10-25-2023 07:56 AM
stewart
Emerging Contributor

Hi,

I am attempting to change the map properties of my ArcGIS Pro Map using ArcPy, though I am struggling to find out how.

target_crs = arcpy.SpatialReference(32632)

arcpy.env.OutputCoordinateSystem = target_crs

arcpy.env.geographicTransformation = target_crs

Tried these and have yet to succeed, any ideas?

Cheers,

Stewart

 

0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

Did you have a look at

Map—ArcGIS Pro | Documentation

spatialReference
(Read and Write)
Provides the ability to get or set the SpatialReference associated with the map.

SpatialReference
transformations
(Read Only)
Returns the horizontal and vertical transformations associated with the map as a Python Dictionary. The dictionary key for horizontal transformations is 2D and 3D for vertical transformations. To modify the existing transformations, use updateTransformations.

and

updateTransformations (transformations)
The updateTransformations method replaces a map's transformations using a dictionary.


... sort of retired...
0 Kudos
stewart
Emerging Contributor

Thanks! My solution was found through your link which linked into a different one. 

map_view = arcpy.mp.ArcGISProject("CURRENT").listMaps("Map")[0]
map_view.spatialReference = arcpy.SpatialReference(32632)
aprx = arcpy.mp.ArcGISProject("CURRENT")
aprx.save()

0 Kudos