Exemplo n.º 1
0
        /// <summary>
        ///     Creates CurtainSystem list.
        /// </summary>
        /// <param name="doc"></param>
        /// <param name="app"></param>
        /// <param name="room"></param>
        /// <param name="pnlType"></param>
        /// <param name="tplFileName"></param>
        public static List <CurtainSystem> CreateCurtainSystemListWithTrans(this Document doc, Application app, SpatialElement room, PanelType pnlType, string tplFileName)
        {
            if (doc == null)
            {
                throw new NullReferenceException(nameof(doc));
            }

            if (room == null)
            {
                throw new NullReferenceException(nameof(room));
            }

            if (app == null)
            {
                throw new NullReferenceException(nameof(app));
            }

            if (pnlType == null)
            {
                throw new NullReferenceException(nameof(pnlType));
            }

            if (tplFileName == null)
            {
                throw new NullReferenceException(nameof(tplFileName));
            }

            var roomc   = room.GetBoundingBox(doc).GetBoxCenter();
            var walls   = room.GetBoundaryWallList(doc);
            var results = new List <CurtainSystem>();

            foreach (var wall in walls)
            {
                var parm = new CurtainSystemParameter(wall, roomc, pnlType, tplFileName);

                results.Add(doc.CreateCurtainSystemWithTrans(app, parm));
            }

            return(results);
        }