goodman

Featureclass cannot run for geodatabase, OK for a shapefile

Discussion created by goodman on Jun 23, 2011
Latest reply on Nov 18, 2011 by goodman
I have a function for modifying a polyline featureclass. It is OK for a shapefile featureclass, the result is OK. But for a geodatabase featureclass, the result cannot modified. The modified featureclass is the same as the input featureclass.
            IFeatureCursor pFCursor = pFeatureclass.Update(null, false);
            IFeature pFeature = pFCursor.NextFeature();
            while (pFeature != null)
            {
                IGeometryCollection pPolColl = pFeature.Shape as IGeometryCollection;
                //get uv
                ISegmentCollection pPathColl = pPolColl.get_Geometry(0) as ISegmentCollection;
                ISegment pSegment = pPathColl.get_Segment(0);
                //uv
                ILine pLine = pSegment as ILine;
                IPoint pPointOrigin = new PointClass();
                pPointOrigin.PutCoords(pLine.FromPoint.X, pLine.FromPoint.Y);
                //
                Double dblOldX, dblOldY;
                dblOldX = pLine.ToPoint.X;
                dblOldY = pLine.ToPoint.Y;

                ITransform2D pTransform2D = pLine as ITransform2D;
                pTransform2D.Scale(pPointOrigin, dblScale, dblScale);

                //
                Double dblNewX, dblNewY;
                dblNewX = pLine.ToPoint.X;
                dblNewY = pLine.ToPoint.Y;

                //
                for (int i = 1; i < 3; i++)
                {
                    pPathColl = pPolColl.get_Geometry(i) as ISegmentCollection;
                    pSegment = pPathColl.get_Segment(0);
                    pLine = pSegment as ILine;
                    //
                    pPointOrigin.PutCoords(pLine.FromPoint.X, pLine.FromPoint.Y);
                    pTransform2D = pLine as ITransform2D;
                    //
                    pTransform2D.Scale(pPointOrigin, dblScale, dblScale);
                    //
                    pTransform2D.Move(dblNewX - dblOldX, dblNewY - dblOldY);
                }
                pPolColl.GeometriesChanged();

                //Update
                pFCursor.UpdateFeature(pFeature);
                pFeature = pFCursor.NextFeature();
            }
            pFCursor.Flush();

Outcomes