I am trying to remove some of the CurtainGridLine segments that are above the westGateHeight like this:
01 XYZ lseg = new XYZ(BasePoints[0][0].X, pointUGateLines[2].Y, westGateHeight);
02
03 CurtainGridLine fLeft = gGeomFront.ActiveGrid.AddGridLine(false, lseg, false);
04
05 CurveArray curvarLeft = fLeft.AllSegmentCurves;
06 CurveArrayIterator citer = curvarLeft.ForwardIterator();
07 citer.Reset();
08 while (citer.MoveNext())
09 {
10 Curve cr = citer.Current as Curve;
11
12 XYZ e0 = cr.get_EndPoint(0);
13 XYZ e1 = cr.get_EndPoint(1);
14
15 fLeft.Lock = false;
16
17 if (e0.Z > westGateHeight)
18 fLeft.RemoveSegment(cr);
19 }
but in line 18 throws an exception "InvalidOperationException was unhandled by user code"
this is topmost segment of the line segments which are below him - correctly deleted
what am I doing wrong? and how to remove the segments?
Hello,
Would you like to post a minimum, ready-to-build sample project to reproduce the problem? It will be easier to take a look.