Example #1
0
        internal static CurtainGridSet AllCurtainGrids(Autodesk.Revit.DB.Element revitElement)
        {
            CurtainGridSet gridSets = null;

            if (revitElement is CurtainSystem)
            {
                var gridAsCurtainSystem = revitElement as CurtainSystem;
                gridSets = gridAsCurtainSystem.CurtainGrids;
            }
            else if (revitElement is ExtrusionRoof)
            {
                var gridAsExtrusionRoof = revitElement as ExtrusionRoof;
                gridSets = gridAsExtrusionRoof.CurtainGrids;
            }
            else if (revitElement is FootPrintRoof)
            {
                var gridAsFootPrintRoof = revitElement as FootPrintRoof;
                gridSets = gridAsFootPrintRoof.CurtainGrids;
            }
            else if (revitElement is Autodesk.Revit.DB.Wall)
            {
                var gridAsWall = revitElement as Autodesk.Revit.DB.Wall;
                gridSets = new CurtainGridSet();
                gridSets.Insert(gridAsWall.CurtainGrid);
            }

            if (gridSets == null || gridSets.Size < 1)
            {
                throw new Exception("Element has no Curtain Grids");
            }
            return(gridSets);
        }
Example #2
0
        /// <summary>
        /// Provides a unified interface to get the curtain grids associated with an element.
        /// </summary>
        /// <param name="element">The host element.</param>
        /// <returns>A CurtainGridSet with 0 or more CurtainGrids, or null if invalid.</returns>
        public static CurtainGridSet GetCurtainGridSet(Element element)
        {
            CurtainGridSet curtainGridSet = null;

            if (element is Wall)
            {
                Wall wall = element as Wall;
                if (!CurtainSystemExporter.IsLegacyCurtainWall(wall))
                {
                    CurtainGrid curtainGrid = wall.CurtainGrid;
                    curtainGridSet = new CurtainGridSet();
                    if (curtainGrid != null)
                    {
                        curtainGridSet.Insert(curtainGrid);
                    }
                }
            }
            else if (element is FootPrintRoof)
            {
                FootPrintRoof footPrintRoof = element as FootPrintRoof;
                curtainGridSet = footPrintRoof.CurtainGrids;
            }
            else if (element is ExtrusionRoof)
            {
                ExtrusionRoof extrusionRoof = element as ExtrusionRoof;
                curtainGridSet = extrusionRoof.CurtainGrids;
            }
            else if (element is CurtainSystem)
            {
                CurtainSystem curtainSystem = element as CurtainSystem;
                curtainGridSet = curtainSystem.CurtainGrids;
            }

            return(curtainGridSet);
        }
Example #3
0
      internal static CurtainGridSet AllCurtainGrids(Autodesk.Revit.DB.Element revitElement)
      {
         CurtainGridSet gridSets = null;
         if (revitElement is CurtainSystem)
         {
            var gridAsCurtainSystem = revitElement as CurtainSystem;
            gridSets = gridAsCurtainSystem.CurtainGrids;
         }
         else if (revitElement is ExtrusionRoof)
         {
            var gridAsExtrusionRoof = revitElement as ExtrusionRoof;
            gridSets = gridAsExtrusionRoof.CurtainGrids;
         }
         else if (revitElement is FootPrintRoof)
         {
            var gridAsFootPrintRoof = revitElement as FootPrintRoof;
            gridSets = gridAsFootPrintRoof.CurtainGrids;
         }
         else if (revitElement is Autodesk.Revit.DB.Wall)
         {
            var gridAsWall = revitElement as Autodesk.Revit.DB.Wall;
            gridSets = new CurtainGridSet();
            gridSets.Insert(gridAsWall.CurtainGrid);
         }

         if (gridSets == null || gridSets.Size < 1)
         {
            throw new Exception("Element has no Curtain Grids");
         }
         return gridSets;
      }
        /// <summary>
        /// Provides a unified interface to get the curtain grids associated with an element.
        /// </summary>
        /// <param name="element">The host element.</param>
        /// <returns>A CurtainGridSet with 0 or more CurtainGrids, or null if invalid.</returns>
        public static CurtainGridSet GetCurtainGridSet(Element element)
        {
            CurtainGridSet curtainGridSet = null;
            if (element is Wall)
            {
                Wall wall = element as Wall;
                if (!CurtainSystemExporter.IsLegacyCurtainWall(wall))
                {
                    CurtainGrid curtainGrid = wall.CurtainGrid;
                    curtainGridSet = new CurtainGridSet();
                    if (curtainGrid != null)
                        curtainGridSet.Insert(curtainGrid);
                }
            }
            else if (element is FootPrintRoof)
            {
                FootPrintRoof footPrintRoof = element as FootPrintRoof;
                curtainGridSet = footPrintRoof.CurtainGrids;
            }
            else if (element is ExtrusionRoof)
            {
                ExtrusionRoof extrusionRoof = element as ExtrusionRoof;
                curtainGridSet = extrusionRoof.CurtainGrids;
            }
            else if (element is CurtainSystem)
            {
                CurtainSystem curtainSystem = element as CurtainSystem;
                curtainGridSet = curtainSystem.CurtainGrids;
            }

            return curtainGridSet;
        }