Exemple #1
0
        /// <summary>
        /// Extrude Roof by Outline, Referenceplane
        /// </summary>
        /// <param name="outline"></param>
        /// <param name="roofType"></param>
        /// <param name="level"></param>
        /// <param name="plane"></param>
        /// <param name="extrusionStart"></param>
        /// <param name="extrusionEnd"></param>
        /// <returns></returns>
        public static Roof ByOutlineExtrusionTypeAndLevel(PolyCurve outline, RoofType roofType, Level level, ReferencePlane plane, double extrusionStart, double extrusionEnd)
        {
            if (!outline.IsClosed)
            {
                throw new ArgumentException(Properties.Resources.OpenInputPolyCurveError);
            }

            var ca = new CurveArray();

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

            var roof = new Roof(ca, plane.InternalReferencePlane, level.InternalLevel, roofType.InternalRoofType, extrusionStart, extrusionEnd);

            DocumentManager.Regenerate();
            return(roof);
        }
Exemple #2
0
        /// <summary>
        /// Create a Revit Roof given its curve outline and Level
        /// </summary>
        /// <param name="outline"></param>
        /// <param name="RoofType"></param>
        /// <param name="level"></param>
        /// <returns>The Roof</returns>
        public static Roof ByOutlineTypeAndLevel(Curve[] outline, RoofType roofType, Level level)
        {
            var polycurve = PolyCurve.ByJoinedCurves(outline);

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

            var ca = new CurveArray();

            polycurve.Curves().ForEach(x => ca.Append(x.ToRevitType()));

            var roof = new Roof(ca, level.InternalLevel, roofType.InternalRoofType);

            DocumentManager.Regenerate();
            return(roof);
        }