/// <summary>
        ///     Gets polyline geometry corresponding to the subcurve(s) between the fromM and the toM.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="fromM">From measurement.</param>
        /// <param name="toM">To measurement.</param>
        /// <param name="offset">The offset.</param>
        /// <returns></returns>
        public static IPolyline GetPolylineByMs(this IMSegmentation4 source, double fromM, double toM, double offset)
        {
            var polyline = source.GetPolylineByMs(fromM, toM);

            var curve = new PolylineClass();

            curve.ConstructOffset(polyline, offset);

            return(curve);
        }
        /// <summary>
        ///     Gets polyline geometry corresponding to the subcurve(s) between the fromM and the toM.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="fromM">From m.</param>
        /// <param name="toM">To m.</param>
        /// <returns></returns>
        public static IPolyline GetPolylineByMs(this IMSegmentation4 source, double fromM, double toM)
        {
            IMAware aware = source as IMAware;

            if (aware != null && aware.MAware)
            {
                var collection = source.GetSubcurveBetweenMs(fromM, toM);
                return(collection as IPolyline);
            }

            return(null);
        }