<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic arcpy: changing a grid spatial projection in a layout in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-changing-a-grid-spatial-projection-in-a/m-p/1557809#M90067</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I have a UTM grid within my map frame, and I would like to use &lt;STRONG&gt;arcpy&lt;/STRONG&gt; to change its projection.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;As far as I can see that can only be done with a CIM definition.&lt;/P&gt;&lt;P&gt;I'm getting an error. Any ideas? Or am I on the wrong path?&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;....&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;cim_mapframe &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; first_mapframe.getDefinition(&lt;/SPAN&gt;&lt;SPAN&gt;'V3'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;cim_mapframe.grids[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;].projectedCoordinateSystem &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; arcpy.SpatialReference(&lt;/SPAN&gt;&lt;SPAN&gt;7854&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;first_mapframe.setDefinition(cim_mapframe)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I get an error when on the setDefinition line.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;AttributeError: SpatialReference: Get attribute X does not exist&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 13 Nov 2024 00:18:31 GMT</pubDate>
    <dc:creator>PeterKT</dc:creator>
    <dc:date>2024-11-13T00:18:31Z</dc:date>
    <item>
      <title>arcpy: changing a grid spatial projection in a layout</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-changing-a-grid-spatial-projection-in-a/m-p/1557809#M90067</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have a UTM grid within my map frame, and I would like to use &lt;STRONG&gt;arcpy&lt;/STRONG&gt; to change its projection.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;As far as I can see that can only be done with a CIM definition.&lt;/P&gt;&lt;P&gt;I'm getting an error. Any ideas? Or am I on the wrong path?&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;....&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;cim_mapframe &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; first_mapframe.getDefinition(&lt;/SPAN&gt;&lt;SPAN&gt;'V3'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;cim_mapframe.grids[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;].projectedCoordinateSystem &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; arcpy.SpatialReference(&lt;/SPAN&gt;&lt;SPAN&gt;7854&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&lt;SPAN&gt;first_mapframe.setDefinition(cim_mapframe)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#3366FF"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I get an error when on the setDefinition line.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;AttributeError: SpatialReference: Get attribute X does not exist&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 13 Nov 2024 00:18:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-changing-a-grid-spatial-projection-in-a/m-p/1557809#M90067</guid>
      <dc:creator>PeterKT</dc:creator>
      <dc:date>2024-11-13T00:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy: changing a grid spatial projection in a layout</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-changing-a-grid-spatial-projection-in-a/m-p/1625778#M96801</link>
      <description>&lt;P&gt;Hi Peter,&lt;/P&gt;&lt;P&gt;Please try using this...&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;cim&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;grids&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;&lt;SPAN&gt;projectedCoordinateSystem&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;SPAN&gt;'wkid'&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;7854&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;'latestWkid'&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;7854&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This work for me.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 23 Jun 2025 16:07:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-changing-a-grid-spatial-projection-in-a/m-p/1625778#M96801</guid>
      <dc:creator>DanielGarcia</dc:creator>
      <dc:date>2025-06-23T16:07:38Z</dc:date>
    </item>
  </channel>
</rss>

