Esempio n. 1
0
        public static void ExportPoint(XYZ point, string header)
        {
            CheckFolder();
            XElement rootXElement = new XElement("Points");

            rootXElement.Add(GetGeometryFromObjects.GetXElementFromPoint(point));
            rootXElement.Save(Path.Combine(FolderName, GetFileName(header)));
        }
Esempio n. 2
0
        public static void ExportLine(Line line, string header)
        {
            CheckFolder();
            XElement rootXElement = new XElement("Lines");

            rootXElement.Add(GetGeometryFromObjects.GetXElementFromLine(line));
            rootXElement.Save(Path.Combine(FolderName, GetFileName(header)));
        }
        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)));
        }
Esempio n. 4
0
        public static void ExportPoints(IEnumerable <XYZ> points, string header)
        {
            CheckFolder();
            XElement rootXElement = new XElement("Points");

            foreach (XYZ point in points)
            {
                rootXElement.Add(GetGeometryFromObjects.GetXElementFromPoint(point));
            }

            rootXElement.Save(Path.Combine(FolderName, GetFileName(header)));
        }
Esempio n. 5
0
        public static void ExportLines(IEnumerable <Line> lines, string header)
        {
            CheckFolder();
            XElement rootXElement = new XElement("Lines");

            foreach (Line line in lines)
            {
                rootXElement.Add(GetGeometryFromObjects.GetXElementFromLine(line));
            }

            rootXElement.Save(Path.Combine(FolderName, GetFileName(header)));
        }
Esempio n. 6
0
        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)));
        }