Esempio n. 1
0
        public void FrameWalls()
        {
            var          studTable               = StudTable.Load(StudTable.FilePath);
            var          exist                   = File.Exists(Table502_3_1.JoistTableLivingAreasPath);
            Table502_3_1 JoistTableLivingAreas   = Table502_3_1.Load(Table502_3_1.JoistTableLivingAreasPath);
            Table502_3_1 JoistTableSleepingAreas = Table502_3_1.Load(Table502_3_1.JoistTableSleepingAreasPath);
            Table502_5   HeadersTableExterior    = Table502_5.Load(Table502_5.HeadersTableExteriorPath);
            Table502_5   HeadersTableInterior    = Table502_5.Load(Table502_5.HeadersTableInteriorPath);


            var       walls    = IfModel.Instances.OfType <IfWall>().ToList();
            var       polygons = WallPolygon.GetPolygons(walls);
            WallFrame wf;

            foreach (var polygon in polygons)
            {
                try
                {
                    wf           = new WallFrame(polygon);
                    wf.StudTable = studTable;
                    wf.New();
                }
                catch (Exception e)
                {
                    Console.WriteLine("Error: " + e.Message);
                }
            }

            var        Floors       = IfModel.Instances.OfType <IfFloor>().ToList();
            var        floorPolygon = FloorPolygon.GetPolygons(Floors);
            FloorFrame Ff;

            foreach (var polygon in floorPolygon)
            {
                try
                {
                    Ff            = new FloorFrame(polygon);
                    Ff.JoistTable = JoistTableLivingAreas;
                    Ff.New();
                }
                catch (Exception e)
                {
                    Console.WriteLine("Error: " + e.Message);
                }
            }
        }
Esempio n. 2
0
        public void Configure(IfModel ifModel, WoodFrame woodFrame)
        {
            #region AsyncMethods
            //string filePath = @"..\..\Models\home-2floor-ft.ifc";
            //Task<IfModel> LoadModelAsync = Task.Factory.StartNew<IfModel>((filepath) =>
            //{
            //    //load Tables;
            //    return IfModel.Open(filePath);
            //}, filePath);

            Task <DesignOptions> LoadDesignOptionsAsync = Task.Factory.StartNew(() =>
            {
                //load settings from Database;
                return(new DesignOptions());
            });

            Task LoadConfigurationAsync = Task.Factory.StartNew(() =>
            {
                //load configuration file from database or whatever;
            });

            Task <StudTable> LoadStudTablesAsync = Task.Factory.StartNew(() =>
            {
                //  load Tables;
                return(StudTable.Load(" "));
            });

            Task <Table502_3_1> LoadHeaderTablesAsync = Task.Factory.StartNew(() =>
            {
                //  load Tables;
                return(Table502_3_1.Load(null));
            });
            //

            #endregion

            //load model design option and configuration
            //ifModel.DesignOptions = LoadDesignOptionsAsync.Result;


            ////load wood frame tables
            //woodFrame.StudTable= LoadStudTablesAsync.Result;
            //woodFrame.JoistTable = LoadHeaderTablesAsync.Result;
        }