public static DividedPath ByCurvesAndDivisions(Revit.Elements.Element[] elements, int divisions) { if (elements == null) { throw new ArgumentNullException("elements"); } if (divisions < 2) { throw new Exception("The number of divisions must be greater than 2!"); } if (elements.Any(x => x == null)) { throw new ArgumentNullException(String.Format("curves[{0}]", Array.FindIndex(elements, x => x == null))); } return new DividedPath(elements.Select(x => ElementCurveReference.TryGetCurveReference(x)).ToArray(), divisions); }