Ejemplo n.º 1
0
        /// <summary>
        /// Create a Revit Ceiling given its curve outline and Level
        /// </summary>
        /// <param name="outline"></param>
        /// <param name="ceilingType"></param>
        /// <param name="level"></param>
        /// <returns>The ceiling</returns>
        public static Ceiling ByOutlineTypeAndLevel(PolyCurve outline, CeilingType ceilingType, Level level)
        {
            if (outline == null)
            {
                throw new ArgumentNullException("outline");
            }

            if (ceilingType == null)
            {
                throw new ArgumentNullException("ceilingType");
            }

            if (level == null)
            {
                throw new ArgumentNullException("level");
            }

            if (!outline.IsClosed)
            {
                throw new ArgumentException(Properties.Resources.OpenInputPolyCurveError);
            }

            CurveLoop loop = new CurveLoop();

            outline.Curves().ForEach(x => loop.Append(x.ToRevitType()));

            List <CurveLoop> loops = new List <CurveLoop> {
                loop
            };

            if (!BoundaryValidation.IsValidHorizontalBoundary(loops))
            {
                throw new ArgumentException(Properties.Resources.NotHorizontalInputPolyCurveError);
            }

            var ceiling = new Ceiling(loops, ceilingType.InternalCeilingType, level.InternalLevel);

            DocumentManager.Regenerate();
            return(ceiling);
        }
Ejemplo n.º 2
0
 public static Ceiling Wrap(Autodesk.Revit.DB.Ceiling ele, bool isRevitOwned)
 {
     return(Ceiling.FromExisting(ele, isRevitOwned));
 }