C# 如何创建点要素并同时在attibute表中添加数据?

C# 如何创建点要素并同时在attibute表中添加数据?,c#,arcgis,arcmap,arcobjects,C#,Arcgis,Arcmap,Arcobjects,我创建了点要素。但ı不能添加数据属性表 IMxDocument pMxdoc = ArcMap.Application.Document as IMxDocument; IPoint pPoint = pMxdoc.ActivatedView.ScreenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y); IFeatureLayer pFLayer = pMxdoc.FocusMap.Layer[3] as IFeatureLayer;

我创建了点要素。但ı不能添加数据属性表

IMxDocument pMxdoc = ArcMap.Application.Document as IMxDocument;
IPoint pPoint = pMxdoc.ActivatedView.ScreenDisplay.DisplayTransformation.ToMapPoint(arg.X, arg.Y);
IFeatureLayer pFLayer = pMxdoc.FocusMap.Layer[3] as IFeatureLayer;
IWorkspaceEdit pWSE = ((IDataset)(pFLayer.FeatureClass)).Workspace as IWorkspaceEdit;
pWSE.StartEditing(false);
pWSE.StartEditOperation();

IFeature pFeature = pFLayer.FeatureClass.CreateFeature();
pFeature.Shape = pPoint;
pFeature.Store();

// I want to add data in table this here but how?

pWSE.StopEditOperation();
pWSE.StopEditing(true);

pMxdoc.ActivatedView.Refresh();

您仅将几何图形指定给特征,但可能需要进一步的属性。因此,应使用以下方法设置当前要素的属性值:

int fieldIndex = myFeatureClass.FindField(attributeName);
object newValue = "newValue";
IFeature pFeature = pFLayer.FeatureClass.CreateFeature();
pFeature.set_Value(fieldIndex, newValue);
pFeature.Shape = pPoint;
pFeature.Store();