持续更新中
三维线打断处理
private static IPolyline SpliteLineAtPoint(IPolyline LineCurve, IPoint SplitePoint)
{
IPolyline pPolyline=null;
IObjectCopy copy = new ObjectCopyClass();
object copyline = LineCurve;
object newcopyLine = copy.Copy(copyline);
IPolyline pTempLine = newcopyLine as IPolyline;
bool isSplit;
int splitIndex, segIndex;
pTempLine.SplitAtPoint(SplitePoint, true, false, out isSplit, out splitIndex, out segIndex);
if (isSplit)
{
IPolyline newLine = new PolylineClass();
ISegmentCollection lineSegCol = (ISegmentCollection)pTempLine;
ISegmentCollection newSegCol = (ISegmentCollection)newLine;
object o = Type.Missing;
for (int j = segIndex; j < lineSegCol.SegmentCount; j++)
{
newSegCol.AddSegment(lineSegCol.get_Segment(j), ref o, ref o);
}
lineSegCol.RemoveSegments(segIndex, lineSegCol.SegmentCount - segIndex, true);
lineSegCol.SegmentsChanged();
newSegCol.SegmentsChanged();
IPolyline oldLine = lineSegCol as IPolyline;
newLine = newSegCol as IPolyline;
IZAware zNew = newLine as IZAware;
zNew.ZAware = true;
IZAware zOld = oldLine as IZAware;
zOld.ZAware = true;
pPolyline = newLine;
}
return pPolyline;
}