<?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 Re: Re-project  Grid in layout in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/re-project-grid-in-layout/m-p/1315462#M10147</link>
    <description>&lt;P&gt;Hi Prashant,&lt;/P&gt;&lt;P&gt;As this question is more than 2 years old I think it won't help you anymore, but I've come across the same issue and I was able to resolve it using the WKT property:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var cimMapFrame = mapFrame.GetDefinition() as CIMMapFrame;
var grid = cimMapFrame.Grids.OfType&amp;lt;CIMMeasuredGrid&amp;gt;().FirstOrDefault();
var pcs = new ArcGIS.Core.Internal.CIM.ProjectedCoordinateSystem {
  WKT = spatialReference.Wkt
};
grid.ProjectedCoordinateSystem = pcs;
mapFrame.SetDefinition(cimMapFrame);&lt;/LI-CODE&gt;&lt;P&gt;I'm not happy to use an undocumented class from ArcGIS.Core.Internal but as far as I could see there is no way around it...&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Markus&lt;/P&gt;</description>
    <pubDate>Fri, 04 Aug 2023 11:24:41 GMT</pubDate>
    <dc:creator>MarkusNoth</dc:creator>
    <dc:date>2023-08-04T11:24:41Z</dc:date>
    <item>
      <title>Re-project  Grid in layout</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/re-project-grid-in-layout/m-p/1048637#M6454</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have layout which contains dataframe and gird. I've 2 maps with different projection. I'm parsing this layout programmatically and switching maps. While switching maps I want to re-project grid based on map projection.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've manually created projected coordinate system object and assign to map grid but new projection not reflecting in grid's coordinate property.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my sample code :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; MapFrame mf = (MapFrame)item;
 CIMMapFrame cimframe = (CIMMapFrame)item.GetDefinition();
if (cimframe.Grids != null)
 foreach (CIMMapGrid grds in cimframe.Grids) 
 {
  SpatialReference sr = mymap.SpatialReference;                                          
  ProjectedCoordinateSystem pcs = new ProjectedCoordinateSystem()
   {
     ..,
     ..,
     LatestWKID = sr.LatestWkid,     
     ..,
    WKID = sr.Wkid
   };
((ArcGIS.Core.CIM.CIMMeasuredGrid)grds).ProjectedCoordinateSystem = pcs;                                        
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;-Prashant&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 08:25:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/re-project-grid-in-layout/m-p/1048637#M6454</guid>
      <dc:creator>PrashantKirpan</dc:creator>
      <dc:date>2021-04-19T08:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Re-project  Grid in layout</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/re-project-grid-in-layout/m-p/1315462#M10147</link>
      <description>&lt;P&gt;Hi Prashant,&lt;/P&gt;&lt;P&gt;As this question is more than 2 years old I think it won't help you anymore, but I've come across the same issue and I was able to resolve it using the WKT property:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var cimMapFrame = mapFrame.GetDefinition() as CIMMapFrame;
var grid = cimMapFrame.Grids.OfType&amp;lt;CIMMeasuredGrid&amp;gt;().FirstOrDefault();
var pcs = new ArcGIS.Core.Internal.CIM.ProjectedCoordinateSystem {
  WKT = spatialReference.Wkt
};
grid.ProjectedCoordinateSystem = pcs;
mapFrame.SetDefinition(cimMapFrame);&lt;/LI-CODE&gt;&lt;P&gt;I'm not happy to use an undocumented class from ArcGIS.Core.Internal but as far as I could see there is no way around it...&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Markus&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2023 11:24:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/re-project-grid-in-layout/m-p/1315462#M10147</guid>
      <dc:creator>MarkusNoth</dc:creator>
      <dc:date>2023-08-04T11:24:41Z</dc:date>
    </item>
  </channel>
</rss>

