<?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: CalculateAreas in ArcObjects 10 in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/calculateareas-in-arcobjects-10/m-p/183185#M4754</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Mossberg&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Try just setting &lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/OverwriteOutput_Property/0047000024w3000000/"&gt;OverwriteOutput &lt;/A&gt;to true. &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you but that is already done, and besides there is no existing file to overwrite. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Also verify that no additional applications or processes are accessing the feature class.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I had the input shapefile opened when running the geotool, in the process that started the geotool. That worked ok in ArcGIS 9 but not in 10. If I close the input shapefile first it works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Error message was thus a bit confusing as it was not the output file that was the problem, but the input file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nevertheless, thank you for your support.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Magnus Mossberg&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 May 2011 04:43:40 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2011-05-06T04:43:40Z</dc:date>
    <item>
      <title>CalculateAreas in ArcObjects 10</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/calculateareas-in-arcobjects-10/m-p/183183#M4752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Mossberg&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a small pice of code that has been working well under ArcObjects 9 but refuses to run under ArcObjects 10.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Private Sub CalculateAreas(ByVal inPath As String, ByVal inName As String, ByVal outPath As String, ByVal outName As String)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RaiseEvent Message("Calculate areas...")

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim gptool As SpatialStatisticsTools.CalculateAreas = New SpatialStatisticsTools.CalculateAreas

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gptool.Input_Feature_Class = inPath &amp;amp; inName
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gptool.Output_Feature_Class = outPath &amp;amp; outName

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mvarGeoProc.Execute(gptool, Nothing)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RaiseMessage("Ready")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch ex As Exception
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ShowGeoProcMessage("Calculate areas")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RaiseMessage("Error : " &amp;amp; ex.Message)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All it does is, using geoprocessing tool, to calculate the areas of the features in a shape file. When I run it under ArcObjects 10 I recive the following error&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Executing: CalculateAreas C:\ArcWork\test\hchange_study.shp C:\ArcWork\test\hchange_area.shp
Start Time: Wed May 04 08:48:56 2011
Running script CalculateAreas...
ERROR 000903: Cannot overwrite: C:\ArcWork\test\hchange_area.shp
ERROR 000852: Cannot add field F_AREA to C:\ArcWork\test\hchange_area.shp
&amp;lt;class 'ErrorUtils.ScriptError'&amp;gt;: Exiting....
Failed to execute (CalculateAreas).
Failed at Wed May 04 08:48:56 2011 (Elapsed Time: 0.00 seconds)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thus the geoprocessor complains that it can't overwrite the output file. Well there is no output file to overwrite.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I run the CalculateAreas tool from the ArcToolbox using the same input file and name of output file it works. But not from within ArcObjects.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any tips on what might cause the problem under ArcObjects 10?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Magnus Mossberg, SLU&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:19:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/calculateareas-in-arcobjects-10/m-p/183183#M4752</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T09:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: CalculateAreas in ArcObjects 10</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/calculateareas-in-arcobjects-10/m-p/183184#M4753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: jmhauck4818&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try just setting &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/OverwriteOutput_Property/0047000024w3000000/"&gt;OverwriteOutput &lt;/A&gt;&lt;SPAN&gt;to true. Also verify that no additional applications or processes are accessing the feature class.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2011 19:54:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/calculateareas-in-arcobjects-10/m-p/183184#M4753</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-05-05T19:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: CalculateAreas in ArcObjects 10</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/calculateareas-in-arcobjects-10/m-p/183185#M4754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: Mossberg&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Try just setting &lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/OverwriteOutput_Property/0047000024w3000000/"&gt;OverwriteOutput &lt;/A&gt;to true. &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you but that is already done, and besides there is no existing file to overwrite. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Also verify that no additional applications or processes are accessing the feature class.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I had the input shapefile opened when running the geotool, in the process that started the geotool. That worked ok in ArcGIS 9 but not in 10. If I close the input shapefile first it works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Error message was thus a bit confusing as it was not the output file that was the problem, but the input file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nevertheless, thank you for your support.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Magnus Mossberg&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 May 2011 04:43:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/calculateareas-in-arcobjects-10/m-p/183185#M4754</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2011-05-06T04:43:40Z</dc:date>
    </item>
  </channel>
</rss>

