Example #1
0
        private void SetRightRegion()
        {
            var storyNo     = WallPolygon.IfWall.Story.StoryNo;
            var height      = WallPolygon.IfWall.IfDimension.ZDim;
            var dim         = IfStud.Setup.Get <IfDimension>("Dimension");
            var maxdistance = StudTable.GetSpace(storyNo + 1, height.Inches, dim).LastOrDefault().Spacing;


            foreach (var region in WallPolygon.RRight)
            {
                var spaces = Split.Distance(region.IfDimension.XDim.Inches, Convert.ToDouble(maxdistance) * 0.0254); //to inch

                spaces = spaces.Where(e => e > .2).ToList();
                spaces.Insert(0, 0);
                for (int i = 0; i < spaces.Count; i++)
                {
                    if (i == 0)
                    {
                        spaces[i] += 0.05 / 2;
                    }
                    ;
                    IfStud ifStud = new IfStud(WallPolygon.IfWall)
                    {
                        IfModel    = WallPolygon.IfWall.IfModel,
                        IfWall     = WallPolygon.IfWall,
                        IfLocation =
                            new IfLocation(region.IfLocation.X + spaces[i],
                                           region.IfLocation.Y,
                                           region.IfLocation.Z),

                        IfDimension = new IfDimension(
                            .05f,
                            .4f,
                            region.IfDimension.ZDim.Inches),
                    };


                    ifStud.New();
                    ifStud.IfMaterial.AttatchTo(ifStud);
                    //add to studs elments
                    IfStuds.Add(ifStud);
                }
            }
        }