<?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: Setting Extent and Mask properties for Geoprocessor not working in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/setting-extent-and-mask-properties-for/m-p/298358#M7736</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I zoomed into a map and set the extent to the current display and then ran the VBA script below to see what came out&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Public Sub x()
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim p As IGeoProcessor
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set p = New GeoProcessor
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim x As String
&amp;nbsp;&amp;nbsp;&amp;nbsp; Let x = p.GetEnvironmentValue("extent")
&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print x
End Sub
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The result is a string with numbers separated by a single SPACE character and not commas. Also the values are anti-clockwise starting with "LEFT BOTTOM RIGHT TOP". Nothing I can find in the ArcObjects API help indicates this what so ever! The only place I have found any indication in what order the limits of your extent should be is &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//001w00000009000000" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt; in Python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 14:19:01 GMT</pubDate>
    <dc:creator>DuncanHornby</dc:creator>
    <dc:date>2021-12-11T14:19:01Z</dc:date>
    <item>
      <title>Setting Extent and Mask properties for Geoprocessor not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/setting-extent-and-mask-properties-for/m-p/298357#M7735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using Geoprocessor in VB.NET and was trying to set the extent so my process is constraint by this extent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When I set the property 'gp.SetEnvironmentValue("extent", "-450554.414000, -1154206.896400, -445014.414000, -1146626.896400");' and ran the GP processor, the output does not match the extent. The same is for Mask property.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried it inside ArcGIS 10 by setting the environment and it works. I am not sure why setting the extent in the code for Geoprocessor is not working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I Found two similar problems on Forum but without reply. Is this Bug in ArcObjects or what? Thanks a lot.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Function GP_ShpToRaster(pFeatureLayer As IFeatureLayer, pFieldNameHeight As String, pFieldNamePriority As String) As IRaster&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Try&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim pCellSize As Short = 20&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim pOutRaster As IRaster&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim gp As IGeoProcessor2 = New ESRI.ArcGIS.Geoprocessing.GeoProcessor()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim util As IGPUtilities3 = New GPUtilitiesClass()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; gp.OverwriteOutput = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; gp.ResetEnvironments()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; gp.SetEnvironmentValue("extent", "-450554.414000, -1154206.896400, -445014.414000, -1146626.896400")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; gp.SetEnvironmentValue("cellSize", 20)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; gp.SetEnvironmentValue("mask", "B:\ISSOP\pokusneData\kysuce")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; gp.SetEnvironmentValue("snapRaster", "B:\ISSOP\pokusneData\kysuce")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; gp.SetEnvironmentValue("workspace", "B:\")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim parameters As IVariantArray = New VarArray&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; parameters.Add(pFeatureLayer)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; parameters.Add(pFieldNameHeight)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; parameters.Add("Output")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; parameters.Add("")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; parameters.Add(pFieldNamePriority)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; parameters.Add(pCellSize)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim result As IGeoProcessorResult2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; result = CType(gp.Execute("PolylineToRaster_conversion", parameters, Nothing), IGeoProcessorResult2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim gpVal As IGPValue = result.GetOutput(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim inmemfc As String = gpVal.GetAsText()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim pRasDataset As IRasterDataset&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; pRasDataset = util.OpenRasterDatasetFromString(inmemfc)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim pRasterLayer As IRasterLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; pRasterLayer = New RasterLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; pRasterLayer.CreateFromDataset(pRasDataset)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; pOutRaster = pRasterLayer.Raster&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Return pOutRaster&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Catch ex As Exception&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; MsgBox(ex.Message)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Return Nothing&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; End Try&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; End Function&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2013 13:08:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/setting-extent-and-mask-properties-for/m-p/298357#M7735</guid>
      <dc:creator>martinmaretta</dc:creator>
      <dc:date>2013-02-26T13:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Extent and Mask properties for Geoprocessor not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/setting-extent-and-mask-properties-for/m-p/298358#M7736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I zoomed into a map and set the extent to the current display and then ran the VBA script below to see what came out&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Public Sub x()
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim p As IGeoProcessor
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set p = New GeoProcessor
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim x As String
&amp;nbsp;&amp;nbsp;&amp;nbsp; Let x = p.GetEnvironmentValue("extent")
&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print x
End Sub
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The result is a string with numbers separated by a single SPACE character and not commas. Also the values are anti-clockwise starting with "LEFT BOTTOM RIGHT TOP". Nothing I can find in the ArcObjects API help indicates this what so ever! The only place I have found any indication in what order the limits of your extent should be is &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//001w00000009000000" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt; in Python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:19:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/setting-extent-and-mask-properties-for/m-p/298358#M7736</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-11T14:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Extent and Mask properties for Geoprocessor not working</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/setting-extent-and-mask-properties-for/m-p/298359#M7737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you ever have questions about how the parameters for a geoprocessing tool should be entered, you should run it manually in ArcMap. The Results window will show how the tool expects the parameters to be passed to it. As Duncan states, the extent doesn't have any comma delimiters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]22263[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 16:36:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/setting-extent-and-mask-properties-for/m-p/298359#M7737</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2013-02-28T16:36:15Z</dc:date>
    </item>
  </channel>
</rss>

