/// <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)); }
/// <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); }
/// <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) { }