<?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: Exclude map layers from SetClipGeometry in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/exclude-map-layers-from-setclipgeometry/m-p/1137574#M7685</link>
    <description>&lt;P&gt;Hi Lesley,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately there is no SetClipGeometry method that allows you to exclude map layers from a clip geometry.&amp;nbsp; However there is a property on the CIMMap object that allows you to specify the layers.&amp;nbsp; The property is called LayersExcludedFromClipping.&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;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a small sample of how you would use it.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;      // find the first layer in the map
      var layer = MapView.Active.Map.GetLayersAsFlattenedList().FirstOrDefault();
      if (layer == null)
        return;

      // create a list of strings
      List&amp;lt;string&amp;gt; layerUris = new List&amp;lt;string&amp;gt;();
      // add the layer URI to the list
      layerUris.Add(layer.URI);

      QueuedTask.Run(() =&amp;gt;
      {
        // create a polygon from the current extent
        var poly = PolygonBuilder.CreatePolygon(MapView.Active.Extent);

        // set the clip geometry
        MapView.Active.Map.SetClipGeometry(poly, null);

        // get the map definition
        var mapDef = MapView.Active.Map.GetDefinition();
        // assign the layers to be excluded 
        mapDef.LayersExcludedFromClipping = layerUris.ToArray();
        // set the map definition
        MapView.Active.Map.SetDefinition(mapDef);
      });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if you have any questions.&lt;/P&gt;&lt;P&gt;We'll update the SetClipGeometry method to include the option to exclude layers in a future release.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Narelle&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jan 2022 19:42:16 GMT</pubDate>
    <dc:creator>NarelleChedzey</dc:creator>
    <dc:date>2022-01-26T19:42:16Z</dc:date>
    <item>
      <title>Exclude map layers from SetClipGeometry</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/exclude-map-layers-from-setclipgeometry/m-p/1137172#M7677</link>
      <description>&lt;P&gt;There is an &lt;A href="https://github.com/kataya/arcgis-pro-sdk/wiki/ProSnippets-MapAuthoring" target="_self"&gt;example&lt;/A&gt; of clipping map layers to a polygon in the ProSnippets for Map Authoring using the SetClipGeometry method. Is there also an API to exclude map layers from the clipping? The ArcGIS Pro map Clip Layers tab provides this capability.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 22:47:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/exclude-map-layers-from-setclipgeometry/m-p/1137172#M7677</guid>
      <dc:creator>LesleyBross1</dc:creator>
      <dc:date>2022-01-25T22:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude map layers from SetClipGeometry</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/exclude-map-layers-from-setclipgeometry/m-p/1137574#M7685</link>
      <description>&lt;P&gt;Hi Lesley,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately there is no SetClipGeometry method that allows you to exclude map layers from a clip geometry.&amp;nbsp; However there is a property on the CIMMap object that allows you to specify the layers.&amp;nbsp; The property is called LayersExcludedFromClipping.&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;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a small sample of how you would use it.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;      // find the first layer in the map
      var layer = MapView.Active.Map.GetLayersAsFlattenedList().FirstOrDefault();
      if (layer == null)
        return;

      // create a list of strings
      List&amp;lt;string&amp;gt; layerUris = new List&amp;lt;string&amp;gt;();
      // add the layer URI to the list
      layerUris.Add(layer.URI);

      QueuedTask.Run(() =&amp;gt;
      {
        // create a polygon from the current extent
        var poly = PolygonBuilder.CreatePolygon(MapView.Active.Extent);

        // set the clip geometry
        MapView.Active.Map.SetClipGeometry(poly, null);

        // get the map definition
        var mapDef = MapView.Active.Map.GetDefinition();
        // assign the layers to be excluded 
        mapDef.LayersExcludedFromClipping = layerUris.ToArray();
        // set the map definition
        MapView.Active.Map.SetDefinition(mapDef);
      });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if you have any questions.&lt;/P&gt;&lt;P&gt;We'll update the SetClipGeometry method to include the option to exclude layers in a future release.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Narelle&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 19:42:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/exclude-map-layers-from-setclipgeometry/m-p/1137574#M7685</guid>
      <dc:creator>NarelleChedzey</dc:creator>
      <dc:date>2022-01-26T19:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude map layers from SetClipGeometry</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/exclude-map-layers-from-setclipgeometry/m-p/1138037#M7702</link>
      <description>&lt;P&gt;Thank you! This worked well. I retrieved a polygon from a feature class to set my clip geometry. Wish I were more competent in LINQ queries when querying the layers to exclude from the clipping, but I got it working!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 19:29:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/exclude-map-layers-from-setclipgeometry/m-p/1138037#M7702</guid>
      <dc:creator>LesleyBross1</dc:creator>
      <dc:date>2022-01-27T19:29:54Z</dc:date>
    </item>
  </channel>
</rss>

