本人现在做到了选中图层中的要素,但是怎么样把选中要素作为shp文件输出,请简要说明一下思路
解决方案:40分
你要先创建一个Shpfile类型的layer,然后将你选中的FeatureClass保存在这个shpfile中就OK了。
IWorkspaceFactory wksf = new ShapefileWorkspaceFactoryClass(); IFeatureWorkspace featureWorkspace = wksf.OpenFromFile(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), 0) as IFeatureWorkspace; IFeatureClass newFeatureClass = featureWorkspace.CreateFeatureClass(shplyrName, fields, null, null, esriFeatureType.esriFTSimple, "Shape", ""); IFeatureLayer newShpLayer = new FeatureLayerClass(); newShpLayer.FeatureClass = yourSelectedFeatureClass; ......