Hey folks,I am trying retrieve a polyline from within a polygon. I use IRing#GetSubCurveEx for this. Afterwards I am trying to build a buffer around the curve, so I build up a polyline from the segments of the curve, as follows:// try counter-clockwise ICurve c1 = ring.GetSubcurveEx(fromDistance, toDistance, false, true, false); IPolyline p1 = new PolylineClass(); ISegmentCollection segments = (ISegmentCollection) p1; segments.AddSegmentCollection((ISegmentCollection) c1); // build a buffer around the curve ITopologicalOperator topo = (ITopologicalOperator) p1; IPolygon buffer = (IPolygon) topo.Buffer(bufferSize);
This code works so far, but on one single polygon it crashes with the following error: 0x8004023E which is the EsriNetworkError NETWORK_E_INVALID_ELEMENT_TYPE. But as I do not use any ERSI-Network-functionality I am somehow confused on this error. Moreover this code works one time on a given polygon, but if I pass this polygon a second time to this part of code the mentioned error occurs. I wonder under which circumstances this error is created if the polygon is known to be simple. Any help appreciatedEDIT: Maybe I should also mention that the first time I use another from- and toPoint for retrieving the subcurve of the ring, but as I also check the distances of the from/to-Points to the ring to be null I can ensure these points are on the boundary of my ring.