<?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 Is there a way to clip map to features via sdk? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/is-there-a-way-to-clip-map-to-features-via-sdk/m-p/732770#M169</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am looking for a solution to a problem I have found. I want to clip my map to the shape of a feature that is either selected or a layer created with just one feature via query. I have found that when using feature.shape.clone() and then setting my map extent to that of the feature. The extent is slightly larger than the feature. If you open the Map properties in pro and clip to feature it will give a different extent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;LayoutProjectItem layoutItem &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Project&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetItems&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;LayoutProjectItem&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FirstOrDefault&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Name&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Equals&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Standard"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
Layout layout &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; layoutItem&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetLayout&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
MapFrame mapFrame &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; layout&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FindElement&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"FrameName"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; MapFrame&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//Get map &lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; mapFrameMap &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; mapFrame&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//Get the specific layer you want from the map&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; lyrOfInterest &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; mapFrameMap&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetLayersAsFlattenedList&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OfType&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;FeatureLayer&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FirstOrDefault&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;RowCursor jCursor1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ExtentFeatureClass&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Search&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;queryFilter&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;jCursor1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;MoveNext&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; RTSNUM &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"RTSNumber"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Feature feature &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Feature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;jCursor1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// Process the feature. For example...&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; pin &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; feature&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;RTSNUM&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToString&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
Geometry geo2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetShape&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Clone&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; selectionEnvelope2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; geo2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Extent&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
mapFrameMap&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetCustomFullExtent&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;selectionEnvelope2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
mapFrame&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetCamera&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;selectionEnvelope2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Below is the resulting map with the feature on top. As you can see the map extent is larger than the feature shape.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="552" src="https://community.esri.com/legacyfs/online/483151_pastedImage_3.png" width="530" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When using clip to shape in the map properties gui this is what I get. There is no data showing outside of the boundary. I need to know f there is a way to achieve this via sdk coding?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/483251_pastedImage_4.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 07:16:12 GMT</pubDate>
    <dc:creator>JamalWest2</dc:creator>
    <dc:date>2021-12-12T07:16:12Z</dc:date>
    <item>
      <title>Is there a way to clip map to features via sdk?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/is-there-a-way-to-clip-map-to-features-via-sdk/m-p/732770#M169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am looking for a solution to a problem I have found. I want to clip my map to the shape of a feature that is either selected or a layer created with just one feature via query. I have found that when using feature.shape.clone() and then setting my map extent to that of the feature. The extent is slightly larger than the feature. If you open the Map properties in pro and clip to feature it will give a different extent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;LayoutProjectItem layoutItem &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Project&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GetItems&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;LayoutProjectItem&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FirstOrDefault&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Name&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Equals&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Standard"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
Layout layout &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; layoutItem&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetLayout&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
MapFrame mapFrame &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; layout&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FindElement&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"FrameName"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; MapFrame&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//Get map &lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; mapFrameMap &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; mapFrame&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//Get the specific layer you want from the map&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; lyrOfInterest &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; mapFrameMap&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetLayersAsFlattenedList&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OfType&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;FeatureLayer&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FirstOrDefault&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;RowCursor jCursor1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ExtentFeatureClass&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Search&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;queryFilter&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;jCursor1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;MoveNext&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; RTSNUM &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"RTSNumber"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Feature feature &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Feature&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;jCursor1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// Process the feature. For example...&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; pin &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; feature&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;RTSNUM&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ToString&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
Geometry geo2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetShape&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Clone&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; selectionEnvelope2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; geo2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Extent&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
mapFrameMap&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetCustomFullExtent&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;selectionEnvelope2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
mapFrame&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetCamera&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;selectionEnvelope2&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Below is the resulting map with the feature on top. As you can see the map extent is larger than the feature shape.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="552" src="https://community.esri.com/legacyfs/online/483151_pastedImage_3.png" width="530" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When using clip to shape in the map properties gui this is what I get. There is no data showing outside of the boundary. I need to know f there is a way to achieve this via sdk coding?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/483251_pastedImage_4.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:16:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/is-there-a-way-to-clip-map-to-features-via-sdk/m-p/732770#M169</guid>
      <dc:creator>JamalWest2</dc:creator>
      <dc:date>2021-12-12T07:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to clip map to features via sdk?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/is-there-a-way-to-clip-map-to-features-via-sdk/m-p/1374854#M11037</link>
      <description>&lt;P&gt;I know it's an old topic, just in case someone ends up here: I think you just missed the actual call to Map.SetClipGeometry(), just before setting full extent. To put it in the same context of the example:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// Process the feature. For example...
var pin = feature[RTSNUM].ToString();
Geometry geo2 = feature.GetShape().Clone();
var selectionEnvelope2 = geo2.Extent;
mapFrameMap.SetClipGeometry(geo2 as Polygon, null);
mapFrameMap.SetCustomFullExtent(selectionEnvelope2);
mapFrame.SetCamera(selectionEnvelope2);‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2024 15:20:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/is-there-a-way-to-clip-map-to-features-via-sdk/m-p/1374854#M11037</guid>
      <dc:creator>Asimov</dc:creator>
      <dc:date>2024-01-26T15:20:05Z</dc:date>
    </item>
  </channel>
</rss>

