Blog

Get SubType of feature class using arcobject.

Posted by Yogesh Sharma Blogs | ArcObject Nov 20, 2012
Get SubType of feature class using arcobject.
Get Subtype of featureclass using arcobject.

IWorkspaceFactory pworkspacefactory = new FileGDBWorkspaceFactoryClass();
            IWorkspace pworkspace = pworkspacefactory.OpenFromFile(@"C:\temp\temp1\Data.gdb", 0);
            IFeatureWorkspace pfeatureworkspace = pworkspace as IFeatureWorkspace;
            IFeatureClass pFeatureclass = pfeatureworkspace.OpenFeatureClass("Manmade_Features");
            FCAliasName = pFeatureclass.AliasName;
            FCType = pFeatureclass.ShapeType.ToString();
            FCShpFldName = pFeatureclass.ShapeFieldName;
            
            IDataset pDataSet = pFeatureclass as IDataset;
            FCName = pDataSet.Name;
           
            ISubtypes psubtype = pFeatureclass as ISubtypes;
            IEnumSubtype penumSubtypes = psubtype.Subtypes;
            int subTypeCode=0;
            String codVal= penumSubtypes.Next(out subTypeCode);
            while (codVal != null)
            {
                SubtypeCodeVal[subTypeCode] = codVal;
                codVal = penumSubtypes.Next(out subTypeCode);
            }
COMMENT USING
PREMIUM SPONSORS
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.
SPONSORED BY
  • MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.