public static void ExportArcs(List <Arc> arcs, string header) { CheckFolder(); XElement rootXElement = new XElement("Arcs"); foreach (Arc arc in arcs) { rootXElement.Add(GetGeometryFromObjects.GetXElementFromArc(arc)); } rootXElement.Save(Path.Combine(FolderName, GetFileName(header))); }
public static void ExportCurves(IEnumerable <Curve> curves, string header) { CheckFolder(); XElement root = new XElement("Curves"); XElement linesRootXElement = new XElement("Lines"); XElement arcsRootXElement = new XElement("Arcs"); foreach (Curve curve in curves) { Line line = curve as Line; if (line != null) { var lineXel = GetGeometryFromObjects.GetXElementFromLine(line); if (lineXel != null) { linesRootXElement.Add(lineXel); } } Arc arc = curve as Arc; if (arc != null) { var arcXel = GetGeometryFromObjects.GetXElementFromArc(arc); if (arcXel != null) { arcsRootXElement.Add(arcXel); } } } if (linesRootXElement.HasElements) { root.Add(linesRootXElement); } if (arcsRootXElement.HasElements) { root.Add(arcsRootXElement); } root.Save(Path.Combine(FolderName, GetFileName(header))); }