Beispiel #1
0
        private void SetJoists()
        {
            RecSection section = IfJoist.Setup.Get <RecSection>("RecSection");
            WoodType   WT      = IfJoist.Setup.Get <WoodType>("WoodType");
            WoodGrade  WG      = IfJoist.Setup.Get <WoodGrade>("WoodGrade");

            foreach (var reg in FloorPolygon.Regions)
            {
                double span  = reg.IfDimension.XDim.Inches;
                var    Cells = JoistTable.Cells.Where(e =>
                                                      e.WoodGrade == WG &&
                                                      e.WoodType == WT &&
                                                      e.SpanToInch >= span &&
                                                      e.DeadLoadPsF == 10 &&
                                                      e.Section == section)
                               .OrderBy(e =>
                                        e.SpanToInch).ToList();
                double S      = Cells[0].Spacing;
                var    spaces = Split.Equal(reg.IfDimension.YDim - section.Width, S);

                for (int i = 0; i < spaces.Count; i++)
                {
                    //var spacingVec = new Vector3D(spaces[i], spaces[i], spaces[i]);
                    var DircVec = new IfLocation(
                        FloorPolygon.IfFloor.ShortDirection.Y * spaces[i],
                        FloorPolygon.IfFloor.ShortDirection.X * spaces[i],
                        FloorPolygon.IfFloor.ShortDirection.Z * spaces[i]
                        );

                    var ifJoist = new IfJoist(FloorPolygon.IfFloor)
                    {
                        IfModel    = FloorPolygon.IfFloor.IfModel,
                        IfFloor    = FloorPolygon.IfFloor,
                        IfLocation = DircVec,

                        IfDimension = new IfDimension(
                            section.Width.Inches,
                            section.Depth.Inches,
                            reg.IfDimension.XDim.Inches),

                        IfMaterial = IfMaterial.Setup.Get <IfMaterial>("Joist")
                    };

                    ifJoist.New();
                    ifJoist.IfMaterial.AttatchTo(ifJoist);
                    //add to studs elments
                    Joists.Add(ifJoist);



                    //
                }
            }
        }
Beispiel #2
0
 public List <TableCell> GetCells(WoodType WT, WoodGrade WG, double DeadLoadPsf, double SpanInInches, double SectionDepth)
 {
     return(Cells.Where(e =>
                        e.WoodGrade == WG &&
                        e.WoodType == WT &&
                        e.DeadLoadPsF >= DeadLoadPsf &&
                        e.SpanToInch > SpanInInches &&
                        e.Section.Depth.Inches >= SectionDepth)
            .OrderBy(e => e.Section.Depth)
            .OrderBy(e => e.SpanToInch)
            .ToList());
 }
Beispiel #3
0
        public static Table Load(string filePath)
        {
            //get the static filePath

            var table = new Table();

            string[] file = File.ReadAllLines(filePath).Where(e => e != ",,,,,,,,").ToArray();

            string[]   Keys  = file[0].Split(new char[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries);
            string[][] cells = new string[file.Length - 1][];
            for (int i = 0; i < cells.Length; i++)
            {
                cells[i] = file[i + 1].Split(new char[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries);
            }

            for (int i = 0; i < cells.Length; i++)
            {
                for (int j = 3; j < 7; j++)
                {
                    Double     space   = Double.Parse(cells[i][0]);
                    RecSection section = new RecSection(int.Parse(Keys[j].Split('*')[0]), int.Parse(Keys[j].Split('*')[1]));
                    Length     L       = Length.FromFeetAndInches(int.Parse(cells[i][j].Split('-')[0]), int.Parse(cells[i][j].Split('-')[1]));
                    //Domain.Ifc.IfDimension Dim = new Domain.Ifc.IfDimension(int.Parse(Keys[j].Split('*')[0]),
                    //    int.Parse(Keys[j].Split('*')[1]),
                    //    int.Parse(cells[i][j].Split('-')[0]) * 12 + int.Parse(cells[i][j].Split('-')[1]));
                    WoodType  WT    = WoodType.Douglas_fir_larch;
                    WoodGrade WG    = new WoodGrade();
                    int       DLPsf = int.Parse(cells[i][7]);
                    switch (cells[i][1])
                    {
                    case "Douglas fir-larch":
                        WT = WoodType.Douglas_fir_larch;
                        break;

                    case "Hem-fir":
                        WT = WoodType.Hem_fir;
                        break;

                    case "Southern pine":
                        WT = WoodType.Southern_pine;
                        break;

                    case "Spruce-pine-fir":
                        WT = WoodType.Spruce_pine_fir;
                        break;

                    default:
                        break;
                    }
                    switch (cells[i][2])
                    {
                    case "SS":
                        WG = WoodGrade.SS;
                        break;

                    case "#1":
                        WG = WoodGrade._1;
                        break;

                    case "#2":
                        WG = WoodGrade._2;
                        break;

                    case "#3":
                        WG = WoodGrade._3;
                        break;

                    default:
                        break;
                    }
                    table.Cells.Add(new TableCell()
                    {
                        Spacing     = space,
                        Section     = section,
                        Span        = L,
                        WoodType    = WT,
                        WoodGrade   = WG,
                        DeadLoadPsF = DLPsf
                    });
                }
            }
            return(table);
        }