<?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: How to create layer with polygon in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-layer-with-polygon/m-p/1225009#M8949</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Oh, I have wrong value.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I Solved it. Thanks! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Oct 2022 01:40:32 GMT</pubDate>
    <dc:creator>SIASIA1</dc:creator>
    <dc:date>2022-10-25T01:40:32Z</dc:date>
    <item>
      <title>How to create layer with polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-layer-with-polygon/m-p/1224576#M8946</link>
      <description>&lt;P&gt;Hi, I want to create layer with polygon.&lt;/P&gt;&lt;P&gt;There is no error but, I can't see polygon UI&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var gl_param = new GraphicsLayerCreationParams { Name = job_id };&lt;BR /&gt;QueuedTask.Run(() =&amp;gt;&lt;BR /&gt;{&lt;BR /&gt;var graphicsLayer = LayerFactory.Instance.CreateLayer&amp;lt;ArcGIS.Desktop.Mapping.GraphicsLayer&amp;gt;(gl_param, map);&lt;BR /&gt;double xMax, yMax, xMin, yMin;&lt;/P&gt;&lt;P&gt;(xMax, yMax) = (a, b);&lt;BR /&gt;(xMin, yMin) = (c, d);&lt;/P&gt;&lt;P&gt;List&amp;lt;Coordinate2D&amp;gt; plyCoords = new List&amp;lt;Coordinate2D&amp;gt;();&lt;BR /&gt;plyCoords.Add(new Coordinate2D(xMax, yMax));&lt;BR /&gt;plyCoords.Add(new Coordinate2D(xMax, yMin));&lt;BR /&gt;plyCoords.Add(new Coordinate2D(xMin, yMax));&lt;BR /&gt;plyCoords.Add(new Coordinate2D(xMin, yMin));&lt;BR /&gt;Polygon poly = PolygonBuilderEx.CreatePolygon(plyCoords);&lt;/P&gt;&lt;P&gt;var poly_symbol = SymbolFactory.Instance.ConstructLineSymbol(&lt;BR /&gt;SymbolFactory.Instance.ConstructStroke(&lt;BR /&gt;ColorFactory.Instance.RedRGB, 1.0, SimpleLineStyle.Solid));&lt;/P&gt;&lt;P&gt;var graphic = new CIMPolygonGraphic()&lt;BR /&gt;{&lt;BR /&gt;Symbol = poly_symbol.MakeSymbolReference(),&lt;BR /&gt;Polygon = poly,&lt;BR /&gt;};&lt;BR /&gt;graphicsLayer.AddElement(graphic);&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 05:43:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-layer-with-polygon/m-p/1224576#M8946</guid>
      <dc:creator>SIASIA1</dc:creator>
      <dc:date>2022-10-24T05:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to create layer with polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-layer-with-polygon/m-p/1224654#M8947</link>
      <description>&lt;P&gt;To test your snippet i used the following code to define the envelope:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var env = MapView.Active.Extent;
(xMax, yMax) = (env.XMax, env.YMax);
(xMin, yMin) = (env.XMin, env.YMin);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works for me, but the graphic i get is a bow tie.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_0-1666616725822.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/54226iE7D61C883D97CE85/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_0-1666616725822.png" alt="Wolf_0-1666616725822.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Because you don't get a graphic at all, i assume that your projection for your a, b, c and d values needs to be defined.&amp;nbsp; I don't know what your projection is, but you have to add it here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Polygon poly = PolygonBuilderEx.CreatePolygon(plyCoords, map.SpatialReference);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Replace map.SpatialReference with the spatial reference for your corner coordinates.&amp;nbsp; I.e.&amp;nbsp;SpatialReferences.WGS84 if you are using lat/long.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 13:14:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-layer-with-polygon/m-p/1224654#M8947</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2022-10-24T13:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to create layer with polygon</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-layer-with-polygon/m-p/1225009#M8949</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Oh, I have wrong value.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I Solved it. Thanks! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2022 01:40:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-create-layer-with-polygon/m-p/1225009#M8949</guid>
      <dc:creator>SIASIA1</dc:creator>
      <dc:date>2022-10-25T01:40:32Z</dc:date>
    </item>
  </channel>
</rss>

