<?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 How to add a feature to a feature class from shape file? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-add-a-feature-to-a-feature-class-from-shape/m-p/221833#M5731</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Experts:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Following is the code I wrote to add a point feature to a shape file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//*********************************************************************&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;public static void AddToFeatureClass(IFeatureClass baseClass, IGeometry newGeometry)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFeature newFeature = baseClass.CreateFeature();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newFeature.Shape = newGeometry;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (newFeature.Shape as IZAware).ZAware = (newGeometry as IZAware).ZAware;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (newFeature.Shape as IMAware).MAware = (newGeometry as IMAware).MAware;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//*********************************************************************&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The code could run through and add a record into the shape file. However, in ArcMap attribute table there is no response when I zoom/pan/flash the added point. When I idenfy the point I found that it has an undefined location (see the following screenshoot).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]14373[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; When I use the Visual Studio debug mode to inspect the new feature, I couldn't find any issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]14374[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; What does it happen? How shall I fix the issue? If more information is needed please let me know. Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 May 2012 16:23:00 GMT</pubDate>
    <dc:creator>SuiHuang</dc:creator>
    <dc:date>2012-05-16T16:23:00Z</dc:date>
    <item>
      <title>How to add a feature to a feature class from shape file?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-add-a-feature-to-a-feature-class-from-shape/m-p/221833#M5731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Experts:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Following is the code I wrote to add a point feature to a shape file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//*********************************************************************&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;public static void AddToFeatureClass(IFeatureClass baseClass, IGeometry newGeometry)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IFeature newFeature = baseClass.CreateFeature();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newFeature.Shape = newGeometry;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (newFeature.Shape as IZAware).ZAware = (newGeometry as IZAware).ZAware;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (newFeature.Shape as IMAware).MAware = (newGeometry as IMAware).MAware;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//*********************************************************************&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The code could run through and add a record into the shape file. However, in ArcMap attribute table there is no response when I zoom/pan/flash the added point. When I idenfy the point I found that it has an undefined location (see the following screenshoot).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]14373[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; When I use the Visual Studio debug mode to inspect the new feature, I couldn't find any issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]14374[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; What does it happen? How shall I fix the issue? If more information is needed please let me know. Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 16:23:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-add-a-feature-to-a-feature-class-from-shape/m-p/221833#M5731</guid>
      <dc:creator>SuiHuang</dc:creator>
      <dc:date>2012-05-16T16:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a feature to a feature class from shape file?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-add-a-feature-to-a-feature-class-from-shape/m-p/221834#M5732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you don't call IFeature.Store then any changes you make to the feature will not be saved.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 17:10:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-add-a-feature-to-a-feature-class-from-shape/m-p/221834#M5732</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2012-05-16T17:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a feature to a feature class from shape file?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-add-a-feature-to-a-feature-class-from-shape/m-p/221835#M5733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: huangs3&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If you don't call IFeature.Store then any changes you make to the feature will not be saved.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Great! It works, thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 18:19:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-add-a-feature-to-a-feature-class-from-shape/m-p/221835#M5733</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-05-16T18:19:54Z</dc:date>
    </item>
  </channel>
</rss>

