Hey folks around,
when trying to update a features geometry by inserting a new point (using the IPointCollection-Interface) I run through an System.Runtime.InteropServices.SEHException which I can´t interpret in any way. But all posts concerning this topic simply add a new Point at the end of the geometry, but never in the middle or at the beginning.
My current code is the following:
// the candidate to add to the result-list ICurve candidate = new PathClass();
IPointCollection curvePoints = (IPointCollection) candidate;
// add the new point at the beginning of the geometry
object before = curvePoints.get_Point(0);
object after = Type.Missing;
curvePoints.AddPoint(fromPoint, ref before, ref after);
Does anyone around know where the error is?
Solved! Go to Solution.
object before = 0 as object; midPoints.AddPoint(m_curve.FromPoint, ref before, ref missing);
object before = 0 as object; midPoints.AddPoint(m_curve.FromPoint, ref before, ref missing);
ICurve candidate = new PathClass(); // the candidate to add to the result-list
IPointCollection curvePoints = (IPointCollection) candidate;
// ...
// add some points to the collection
// ...
// add the point at the beginning of the geometry
object before = (object) 0; // rather then curvePoints.get_Point(0); we could also use (object) 3 or whatever index we need
object after = Type.Missing;
curvePoints.AddPoint(fromPoint, ref before, ref after);