Esempio n. 1
0
        private void SetBottomPlate()
        {
            var      wl   = WallPolygon.IfWall.IfLocation;
            var      wd   = WallPolygon.IfWall.IfDimension;
            var      dim  = IfSill.Setup.Get <IfDimension>("Dimension");
            UnitName unit = WallPolygon.IfWall.IfModel.IfUnit.LengthUnit;

            switch (unit)
            {
            case UnitName.MILLIMETRE:
                //dim = dim.ToMilliMeters();
                break;

            case UnitName.METRE:

                //dim = dim.ToMeters();
                break;

            default:
                //dim = dim.ToFeet();
                break;
            }
            var location = new IfLocation(wd.XDim.Inches / 2, 0, -dim.ZDim.Inches);
            var plate    = new IfSill(WallPolygon.IfWall)
            {
                IfLocation     = location,
                IfDimension    = new IfDimension(wd.XDim, dim.YDim, dim.ZDim),
                IfMaterial     = IfMaterial.Setup.Get <IfMaterial>("BottomPlate"),
                IfModel        = WallPolygon.IfWall.IfModel,
                LocalPlacement = (IfcLocalPlacement)WallPolygon.IfWall.LocalPlacement
            };

            plate.New();
            plate.IfMaterial.AttatchTo(plate);
        }
Esempio n. 2
0
        private void SetWindowSills()
        {
            var      wl   = WallPolygon.IfWall.IfLocation;
            var      wd   = WallPolygon.IfWall.IfDimension;
            var      dim  = IfSill.Setup.Get <IfDimension>("Dimension");
            UnitName unit = WallPolygon.IfWall.IfModel.IfUnit.LengthUnit;

            switch (unit)
            {
            case UnitName.MILLIMETRE:
                //dim = dim.ToMilliMeters();
                break;

            case UnitName.METRE:

                //dim = dim.ToMeters();
                break;

            default:
                //dim = dim.ToFeet();
                break;
            }

            var regions = WallPolygon.RBottom;

            foreach (var region in regions)
            {
                var header = new IfSill(WallPolygon.IfWall);
                var l      = region.IfLocation;
                var d      = region.IfDimension;

                if (region.Direction == Direction.Positive)
                {
                    header.IfLocation = new IfLocation(l.X + d.XDim.Inches / 2, l.Y, l.Z);
                }
                else
                {
                    header.IfLocation = new IfLocation(l.X - d.XDim.Inches / 2, l.Y, l.Z);
                }

                header.IfDimension    = new IfDimension(d.XDim.Inches, dim.YDim.Inches, d.ZDim.Inches / 4);
                header.IfModel        = WallPolygon.IfWall.IfModel;
                header.LocalPlacement = region.LocalPlacement;
                header.New();
                Headers.Add(header);
                header.IfMaterial = IfMaterial.Setup.Get <IfMaterial>("Header");
                header.IfMaterial.AttatchTo(header);
                region.IfDimension.ZDim -= header.IfDimension.ZDim;
                region.IfLocation.Z     += header.IfDimension.ZDim;
            }
        }