Exemplo n.º 1
0
        /// <summary>
        /// Convert a Nucleus polyline to a Revit one
        /// </summary>
        /// <param name="polyLine"></param>
        /// <returns></returns>
        public static AD.PolyLine Convert(FB.PolyLine polyLine)
        {
            IList <XYZ> pts = Convert(polyLine.Vertices.ExtractPoints());

            if (polyLine.Closed)
            {
                pts.Add(Convert(polyLine.StartPoint));
            }
            return(AD.PolyLine.Create(pts));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get the polyline representing the border of the cell with the specified index
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="map"></param>
        /// <param name="cellIndex"></param>
        /// <returns></returns>
        public static PolyLine CellBorder <T>(this ICellMap <T> map, int cellIndex)
        {
            int vC = map.VertexCount(cellIndex);

            if (vC > 0)
            {
                var result = new PolyLine();
                for (int i = 0; i < vC; i++)
                {
                    result.Add(map.CellVertex(cellIndex, i));
                }
                result.Close();
                return(result);
            }
            return(null);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Create a PolyLine that is a copy of another PolyLine
 /// </summary>
 /// <param name="other"></param>
 public PolyLine(PolyLine other)
     : this(other.Points, other.Closed, other.Attributes)
 {
 }