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);
            }
post comment
     
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Get Career Advice from Experts