About reading features from Dgn file ?

02-24-2014 07:21 PM
Occasional Contributor II
Hi everyone,

I am getting a problem when try to read features from the Dgn files using ArcObjects. After I delete some elements (polygons) in Dgn file. They still exist when reading the dgn file.

Do you know how to ignore the deleted features ? Please see my code:

           Type factoryType = Type.GetTypeFromProgID(
            System.Object obj = Activator.CreateInstance(factoryType);

            factory = obj as IWorkspaceFactory;

            IFeatureWorkspace ftrWorkSpace = (IFeatureWorkspace)factory.OpenFromFile(strWorkSpace, 0);
            IFeatureDataset pFeatureDataset = ftrWorkSpace.OpenFeatureDataset(strFileName);
            IFeatureClassContainer pFeatureClassContainer = (IFeatureClassContainer)pFeatureDataset;
            IFeatureClass pCadPolygon;
            pCadPolygon = pFeatureClassContainer.get_ClassByName("polygon");
            IFeatureCursor pFeatureCursor = pCadPolygon.Search(null, false);
            if (pFeatureCursor == null)
                return false;
            While (pFeature != null)

Thanks and regards,
Tags (2)
0 Kudos
0 Replies