<?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: Creating an extent indicator in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-an-extent-indicator/m-p/1158072#M7975</link>
    <description>&lt;P&gt;try something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; var extent = new CIMExtentIndicator {
   SourceMapFrame = "Main Map Frame",
   Symbol = extentPoly.MakeSymbolReference(),
 };
 cimAOI.ExtentIndicators = new List&amp;lt;CIMExtentIndicator&amp;gt; { extent}.ToArray();&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 25 Mar 2022 22:08:51 GMT</pubDate>
    <dc:creator>CharlesMacleod</dc:creator>
    <dc:date>2022-03-25T22:08:51Z</dc:date>
    <item>
      <title>Creating an extent indicator</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-an-extent-indicator/m-p/1157211#M7964</link>
      <description>&lt;P&gt;I'm creating a map layout in C#. I have 2 map frames; one is the main frame, the other is an area of interest frame that needs an extent indicator. I'm able to create everything on the layout, except I can't seem to figure out how to plug the CIMExtentIndicator definition into the CIMMapFrame Element.&lt;/P&gt;&lt;P&gt;Here's the relevant code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;//MapFrame Creation
                Coordinate2D ll = new Coordinate2D(0.25, 1.3);
                Coordinate2D ur = new Coordinate2D(10.75, 8);
                Envelope mapEnv = EnvelopeBuilder.CreateEnvelope(ll, ur);
                //AOI map frame
                Coordinate2D ll_aoi = new Coordinate2D(10.05, .25);
                Coordinate2D ur_aoi = new Coordinate2D(10.72, 1.25);
                Envelope mapEnv_aoi = EnvelopeBuilder.CreateEnvelope(ll_aoi, ur_aoi);

                MapFrame newMapFrame = LayoutElementFactory.Instance.CreateMapFrame(newLayout, mapEnv, newMap);
                newMapFrame.SetName("Main Map Frame");
                MapFrame AOI = LayoutElementFactory.Instance.CreateMapFrame(newLayout, mapEnv_aoi, aoiMap);
                var cimAOI = AOI.GetDefinition() as CIMMapFrame;
                AOI.SetName("AOI Frame");
                
                CIMStroke extentOutline = SymbolFactory.Instance.ConstructStroke(ColorFactory.Instance.RedRGB, 1.0, SimpleLineStyle.Solid);
                CIMPolygonSymbol extentPoly = SymbolFactory.Instance.ConstructPolygonSymbol(ColorFactory.Instance.BlackRGB, SimpleFillStyle.Null, extentOutline);
                var extent = new CIMExtentIndicator
                
                {
                    SourceMapFrame = "Main Map Frame",
                    Symbol = extentPoly.MakeSymbolReference(),
                    
                };

                cimAOI.ExtentIndicators[0] = extent;               
                AOI.SetDefinition(cimAOI); //exception thrown: the Object is null&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I notice that the CIMExtentIndicator property on the CIMMapFrame element contains square brackets [], meaning it requires an index integer, but I'm just not sure how to form the correct syntax.&lt;/P&gt;&lt;P&gt;I'm using VS2019. No build issues occur before running the code. If I comment out the extent indicator code, everything works perfectly.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2022 12:04:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-an-extent-indicator/m-p/1157211#M7964</guid>
      <dc:creator>starenix</dc:creator>
      <dc:date>2022-03-24T12:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an extent indicator</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-an-extent-indicator/m-p/1158072#M7975</link>
      <description>&lt;P&gt;try something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; var extent = new CIMExtentIndicator {
   SourceMapFrame = "Main Map Frame",
   Symbol = extentPoly.MakeSymbolReference(),
 };
 cimAOI.ExtentIndicators = new List&amp;lt;CIMExtentIndicator&amp;gt; { extent}.ToArray();&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 25 Mar 2022 22:08:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-an-extent-indicator/m-p/1158072#M7975</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2022-03-25T22:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an extent indicator</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-an-extent-indicator/m-p/1158500#M7980</link>
      <description>&lt;P&gt;Yes! That works perfectly, thank you so much Charles!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Mar 2022 18:07:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-an-extent-indicator/m-p/1158500#M7980</guid>
      <dc:creator>starenix</dc:creator>
      <dc:date>2022-03-28T18:07:03Z</dc:date>
    </item>
  </channel>
</rss>

