-1
我創建了點要素。但我不能添加數據屬性表。如何創建點要素並同時在屬性表中添加數據?
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();
它正在工作。感謝HimBromBeere –