<?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: CIMPolygonGraphic.Name not getting set? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/cimpolygongraphic-name-not-getting-set/m-p/1223516#M8925</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My code is a little bit different and it works on ArcGIS Pro 9.2&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var poly_symbol = SymbolFactory.Instance.ConstructPolygonSymbol(CIMColor.CreateRGBColor(130, 130, 130, 40));
var graphic = new CIMPolygonGraphic()
{
    Symbol = poly_symbol.MakeSymbolReference(),
    Polygon = box
};
graphic.Name = "ExtentSelection";
displayLayer.AddElement(graphic);&lt;/LI-CODE&gt;&lt;P&gt;It seems that CIMPolygonGraphic constructor overrides Name you set&lt;/P&gt;</description>
    <pubDate>Wed, 19 Oct 2022 19:05:30 GMT</pubDate>
    <dc:creator>GKmieliauskas</dc:creator>
    <dc:date>2022-10-19T19:05:30Z</dc:date>
    <item>
      <title>CIMPolygonGraphic.Name not getting set?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/cimpolygongraphic-name-not-getting-set/m-p/1223469#M8922</link>
      <description>&lt;P&gt;I apologize if this is a dumb question, I'm new.&lt;/P&gt;&lt;P&gt;I have a tool that allows a user to sketch a selection rectangle on a graphics layer, and I'm trying to set the Name property so I can refer to it again, but after adding the element to the layer, the Name property ends up being "Rectangle".&amp;nbsp; This code is in OnSketchCompleteAsync:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Polygon box = geometry as Polygon;
QueuedTask.Run(() =&amp;gt;
{
    var poly_symbol = SymbolFactory.Instance.ConstructPolygonSymbol(CIMColor.CreateRGBColor(130, 130, 130, 40));
    var graphic = new CIMPolygonGraphic()
    {
        Symbol = poly_symbol.MakeSymbolReference(),
        Polygon = box,
        Name = "ExtentSelection"
    };
    displayLayer.AddElement(graphic);
});&lt;/LI-CODE&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 17:43:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/cimpolygongraphic-name-not-getting-set/m-p/1223469#M8922</guid>
      <dc:creator>DanielRatzlaff</dc:creator>
      <dc:date>2022-10-19T17:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: CIMPolygonGraphic.Name not getting set?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/cimpolygongraphic-name-not-getting-set/m-p/1223484#M8923</link>
      <description>&lt;P&gt;Sorry, I figured it out.&amp;nbsp; The Name needed to be set on the Element, not the CIMPolygonGraphic:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var poly_symbol = SymbolFactory.Instance.ConstructPolygonSymbol(CIMColor.CreateRGBColor(130, 130, 130, 40));
var graphic = new CIMPolygonGraphic()
{
    Symbol = poly_symbol.MakeSymbolReference(),
    Polygon = box
};
displayLayer.AddElement(graphic,"ExtentSelection");&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 19 Oct 2022 18:05:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/cimpolygongraphic-name-not-getting-set/m-p/1223484#M8923</guid>
      <dc:creator>DanielRatzlaff</dc:creator>
      <dc:date>2022-10-19T18:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: CIMPolygonGraphic.Name not getting set?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/cimpolygongraphic-name-not-getting-set/m-p/1223516#M8925</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My code is a little bit different and it works on ArcGIS Pro 9.2&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var poly_symbol = SymbolFactory.Instance.ConstructPolygonSymbol(CIMColor.CreateRGBColor(130, 130, 130, 40));
var graphic = new CIMPolygonGraphic()
{
    Symbol = poly_symbol.MakeSymbolReference(),
    Polygon = box
};
graphic.Name = "ExtentSelection";
displayLayer.AddElement(graphic);&lt;/LI-CODE&gt;&lt;P&gt;It seems that CIMPolygonGraphic constructor overrides Name you set&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 19:05:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/cimpolygongraphic-name-not-getting-set/m-p/1223516#M8925</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2022-10-19T19:05:30Z</dc:date>
    </item>
  </channel>
</rss>

