private List<SegmentLine2D> ConvertCurveToSegment(CurveArray curveArray)
{
List<SegmentLine2D> resultList = new List<SegmentLine2D>();
// convert the skipped segments (in Curve format) to SegmentLine2D format
foreach (Curve curve in curveArray)
{
Autodesk.Revit.DB.XYZ point1 = curve.get_EndPoint(0);
Autodesk.Revit.DB.XYZ point2 = curve.get_EndPoint(1);
Vector4 v1 = new Vector4(point1);
Vector4 v2 = new Vector4(point2);
// transform from 3D point to 2D point
v1 = m_coordinates.TransformMatrix.Transform(v1);
v2 = m_coordinates.TransformMatrix.Transform(v2);
// add the segment data
SegmentLine2D segLine2D = new SegmentLine2D();
segLine2D.StartPoint = new System.Drawing.Point((int)v1.X, (int)v1.Y);
segLine2D.EndPoint = new System.Drawing.Point((int)v2.X, (int)v2.Y);
resultList.Add(segLine2D);
}
return resultList;
}