AnsweredAssumed Answered

How to add a feature to a feature class from shape file?

Question asked by huangs3 on May 16, 2012
Latest reply on May 16, 2012 by geonetadmin
Hi Experts:

    Following is the code I wrote to add a point feature to a shape file.

public static void AddToFeatureClass(IFeatureClass baseClass, IGeometry newGeometry)
    IFeature newFeature = baseClass.CreateFeature();
    newFeature.Shape = newGeometry;
    (newFeature.Shape as IZAware).ZAware = (newGeometry as IZAware).ZAware;
    (newFeature.Shape as IMAware).MAware = (newGeometry as IMAware).MAware;

    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).


    When I use the Visual Studio debug mode to inspect the new feature, I couldn't find any issue.

    What does it happen? How shall I fix the issue? If more information is needed please let me know. Thank you.