根据要素创建要素类

//根据模型构建要素类
        private IFeatureClass PRV_FeatureClassBuild(IFeature IN_Feature,string IN_FeatureCLassName,IFeatureDataset IN_FeatureDataset)
        {
            //作为搭建模型的要素
            IFeature Temp_MoudleFeature = IN_Feature as IFeature;
            //生成要素类需要CLSID和EXCLSID
            IFeatureClassDescription Temp_FeatureClassDescription = new FeatureClassDescriptionClass();
            IObjectClassDescription Temp_ObjectClassDescription = (IObjectClassDescription)Temp_FeatureClassDescription;
            //以模型要素为模板构建一个要素类
            IN_FeatureDataset.CreateFeatureClass(IN_FeatureCLassName, Temp_MoudleFeature.Fields, Temp_ObjectClassDescription.InstanceCLSID, Temp_ObjectClassDescription.ClassExtensionCLSID, Temp_MoudleFeature.FeatureType, "Shape", "");
            //返回生成的目标要素类
            return (IN_FeatureDataset.Workspace as IFeatureWorkspace).OpenFeatureClass(IN_FeatureCLassName);
        }

输入要素为模板,IN_FeatureDataset为要新建要素类的要素数据集

转载自:https://blog.csdn.net/u011609113/article/details/50976725

You may also like...