Blog
157   0

Get Domain values of workspace using arcobject.

By Yogesh Sharma Blogs | ArcObject Nov 20, 2012
Get Domain values of workspace using arcobject.
Get Domain values of workspace using arcobject.

            IWorkspaceFactory pworkspacefactory = new FileGDBWorkspaceFactoryClass();

            IWorkspace pworkspace = pworkspacefactory.OpenFromFile(@"C:\temp\temp1\Data.gdb", 0);

            IFeatureWorkspace pfeatureworkspace = pworkspace as IFeatureWorkspace;

            IWorkspaceDomains pwsDomain = pworkspace as IWorkspaceDomains;
            IEnumDomain penumdomain = pwsDomain.Domains;
            ICodedValueDomain pCodevalueDomain = null;
            IDomain pDomain= penumdomain.Next();
            Hashtable CodeVal = new Hashtable();
            
            
            while (pDomain != null)
            {
                pCodevalueDomain = pDomain as ICodedValueDomain;
                Hashtable codVal = new Hashtable();
                for (int i = 0; i < pCodevalueDomain.CodeCount; i++)
                {
                    codVal[pCodevalueDomain.get_Name(i)] = pCodevalueDomain.get_Value(i);
                }
                CodeVal[pDomain.Name] = codVal;
                pDomain = penumdomain.Next();
            }

COMMENT USING

PREMIUM SPONSORS

Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

Latest Blogs