private GridLine2D ConvertToLine2D(CurtainGridLine line, List<GraphicsPath> segPaths, int gridLineIndex)
{
Curve curve = line.FullCurve;
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);
// create a new line in GridLine2D format
GridLine2D line2D = new GridLine2D();
line2D.StartPoint = new System.Drawing.Point((int)v1.X, (int)v1.Y);
line2D.EndPoint = new System.Drawing.Point((int)v2.X, (int)v2.Y);
line2D.Locked = line.Lock;
line2D.IsUGridLine = line.IsUGridLine;
// get which segments are skipped
List<SegmentLine2D> skippedSegments = ConvertCurveToSegment(line.SkippedSegmentCurves);
// get all the segments for the curtain grid (and tag the skipped ones out)
GetSegments(line2D, line.AllSegmentCurves, skippedSegments, segPaths, gridLineIndex);
return line2D;
}