Пример #1
0
        /***************************************************/

        public static oM.Geometry.Polyline FromRevit(this Polyloop polyloop)
        {
            IList <XYZ> xyzList = polyloop.GetPoints();

            if (xyzList == null || xyzList.Count < 2)
            {
                return(null);
            }

            List <oM.Geometry.Point> points = xyzList.Select(x => x.PointFromRevit()).ToList();

            points.Add(points[0]);
            return(new oM.Geometry.Polyline {
                ControlPoints = points
            });
        }
Пример #2
0
        public static Polygon3D ToSAM(this Polyloop polyloop)
        {
            if (polyloop == null)
            {
                return(null);
            }

            List <Point3D> point3Ds = new List <Point3D>();

            foreach (XYZ xyz in polyloop.GetPoints())
            {
                point3Ds.Add(xyz.ToSAM());
            }

            if (point3Ds.Count < 3)
            {
                return(null);
            }

            return(new Polygon3D(point3Ds));
        }