Exemplo n.º 1
0
        /// <summary>
        ///get all panels of curtain wall, system or slope glazing roof
        /// </summary>
        /// <param name="hostingElement"></param>
        public static CurtainPanel[] ByElement(Element hostingElement)
        {
            CurtainGridSet thisSet = CurtainGrid.AllCurtainGrids(hostingElement.InternalElement);
            var            result  = new List <CurtainPanel>();

            var enumGrid = thisSet.GetEnumerator();

            for (; enumGrid.MoveNext();)
            {
                var grid   = (Autodesk.Revit.DB.CurtainGrid)enumGrid.Current;
                var ids    = grid.GetPanelIds();
                var idEnum = ids.GetEnumerator();
                for (; idEnum.MoveNext();)
                {
                    var idPanel = idEnum.Current;
                    var panel   = DocumentManager.Instance.CurrentDBDocument.GetElement(idPanel);
                    result.Add(CurtainPanel.FromExisting(panel as Autodesk.Revit.DB.Panel, true));
                }
            }
            return(result.ToArray());
        }
Exemplo n.º 2
0
        /// <summary>
        ///get all mullions of curtain wall, system or slope galzing roof
        /// </summary>
        /// <param name="hostingElement"></param>
        public static Mullion[] ByElement(Element hostingElement)
        {
            CurtainGridSet thisSet = CurtainGrid.AllCurtainGrids(hostingElement.InternalElement);
            var            result  = new List <Mullion>();

            var enumGrid = thisSet.GetEnumerator();

            for (; enumGrid.MoveNext();)
            {
                var grid   = (Autodesk.Revit.DB.CurtainGrid)enumGrid.Current;
                var ids    = grid.GetMullionIds();
                var idEnum = ids.GetEnumerator();
                for (; idEnum.MoveNext();)
                {
                    var idMullion = idEnum.Current;
                    var mullion   = DocumentManager.Instance.CurrentDBDocument.GetElement(idMullion);
                    result.Add(Mullion.FromExisting(mullion as Autodesk.Revit.DB.Mullion, true));
                }
            }
            return(result.ToArray());
        }