Пример #1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            sMaterial material  = null;
            double    diameter  = 0.0;
            double    thickness = 0.0;

            if (!DA.GetData(0, ref material))
            {
                return;
            }
            if (!DA.GetData(1, ref diameter))
            {
                return;
            }
            if (!DA.GetData(2, ref thickness))
            {
                return;
            }

            sCrossSection cs = new sCrossSection();

            eSectionType stype = eSectionType.ROUND;

            string mss    = "Round: Dia " + diameter;
            string shapeN = "Round_" + diameter;

            if (thickness > 0.0)
            {
                mss    += ", Th " + thickness;
                shapeN += "x" + thickness;
            }
            cs.shapeName = shapeN;
            this.Message = mss;

            cs.sectionType = stype;

            string          modelUnit = Rhino.RhinoDoc.ActiveDoc.ModelUnitSystem.ToString();
            sRhinoConverter rhcon     = new sRhinoConverter(modelUnit, "Meters");

            if (modelUnit == "Feet")
            {
                diameter  /= 12.0;
                thickness /= 12.0;
            }

            diameter  = Math.Round(diameter, 3);
            thickness = Math.Round(thickness, 3);

            cs.dimensions = new List <double>();
            cs.dimensions.Add(rhcon.EnsureUnit(diameter));
            if (thickness > 0.0)
            {
                cs.dimensions.Add(rhcon.EnsureUnit(thickness));
            }

            cs.material = material;


            DA.SetData(0, cs);
        }
        //there are few shapes KodeStruct doesn't recognize. i.g. W8X10
        public ISection ToKodeStructCrossSection(sCrossSection sCs)
        {
            ISection         shape    = null;
            AiscShapeFactory shapeFac = new AiscShapeFactory();

            if (sCs.sectionType == eSectionType.AISC_I_BEAM)
            {
                shape = shapeFac.GetShape(sCs.shapeName);
            }
            else if (sCs.sectionType == eSectionType.HSS_REC)
            {
            }
            else if (sCs.sectionType == eSectionType.HSS_ROUND)
            {
            }
            else if (sCs.sectionType == eSectionType.RECTANGLAR)
            {
            }
            else if (sCs.sectionType == eSectionType.ROUND)
            {
            }
            else if (sCs.sectionType == eSectionType.SQUARE)
            {
            }
            return(shape);
        }
        public double GetDemand_LocalDeflection_Vertical(sCrossSection c, IFrameSet fs_Live)
        {
            double def_local = fs_Live.GetFrameSetDemand(eColorMode.Deflection_Local);

            double IyyRatio = (fs_Live.crossSection.I_StrongAxis / c.I_StrongAxis);

            double def_adjusted = IyyRatio * def_local;

            def_adjusted *= 0.0393701;//mm to in
            return(def_adjusted);
        }
Пример #4
0
        public static object Get_sAISCSection(string shapeName)
        {
            sCrossSection cs = new sCrossSection(shapeName);

            sMaterial mat = new sMaterial();

            mat.materialName = "Steel";
            mat.materialType = eMaterialType.STEEL_A36;
            cs.material      = mat;

            return(new Dictionary <string, object>
            {
                { "sCrossSection", cs }
            });
        }
        public double GetDemand_Flexural_Vertical(sCrossSection c, IFrameSet fs_Full, IFrameSet fs_Minute)
        {
            //strength check
            double momentY_full = fs_Full.GetFrameSetDemand(eColorMode.Moment_Y);
            double momentY_min  = fs_Minute.GetFrameSetDemand(eColorMode.Moment_Y);
            double momentY_self = (momentY_full - momentY_min);

            double selfWeightRatio = (c.weight / fs_Full.crossSection.weight);

            double momentY_adjusted = ((momentY_self * selfWeightRatio) + momentY_min);

            momentY_adjusted *= 0.28476439306;//N.m > kip.in

            return(momentY_adjusted);
        }
Пример #6
0
        public static object Get_sRectangularSection(sMaterial material, double width_in, double depth_in, double thickness_in = 0.0)
        {
            sCrossSection cs     = new sCrossSection();
            string        shapeN = "";

            if (Math.Abs(width_in - depth_in) < 0.0001)
            {
                cs.sectionType = eSectionType.SQUARE;
                shapeN        += "Square_" + width_in + "x" + depth_in;
            }
            else
            {
                cs.sectionType = eSectionType.RECTANGLAR;
                shapeN        += "Rectangular_" + width_in + "x" + depth_in;
            }
            if (thickness_in > 0.0)
            {
                shapeN += "x" + thickness_in;
            }

            sDynamoConverter dycon = new sDynamoConverter("Feet", "Meters");

            width_in     /= 12.0;
            depth_in     /= 12.0;
            thickness_in /= 12.0;


            width_in     = Math.Round(width_in, 3);
            depth_in     = Math.Round(depth_in, 3);
            thickness_in = Math.Round(thickness_in, 3);

            cs.dimensions = new List <double>();
            cs.dimensions.Add(dycon.EnsureUnit_Dimension(width_in));
            cs.dimensions.Add(dycon.EnsureUnit_Dimension(depth_in));
            if (thickness_in > 0.0)
            {
                cs.dimensions.Add(dycon.EnsureUnit_Dimension(thickness_in));
            }

            cs.shapeName = shapeN;

            cs.material = material;

            return(new Dictionary <string, object>
            {
                { "sCrossSection", cs }
            });
        }
        public double GetFlexuralStrength_Vertical(sCrossSection section, eColorMode forceType, IFrameSet fs)
        {
            sKodeStructConverter kcon = new sKodeStructConverter();
            SteelMaterial        mat  = kcon.ToKodeStructMaterial_Steel(section);

            string Code   = "AISC360-10";
            double phiM_n = 0;

            double b_eff  = this.GetBeamEffectiveSlabWidth(fs);
            double SumQ_n = this.GetSumOfStudsStrength(fs);
            // assuming,
            // Shear Stud Anchor
            // Light Weight Concrete : 4ksi
            // solid concrete thickness = 2.5"
            // rib thickness = 3"
            //
            double h_solid  = 2.5;
            double h_rib    = 3.0;
            double F_y      = mat.YieldStress; //?? unit ?? F_y of what??
            double fc_prime = 4.0;             //?? unit ??

            MomentAxis Axis = kcon.ToKodeStructMomentAxis(forceType);

            //?? just this for composite?
            ISection shape = kcon.ToKodeStructCrossSection(section);

            if (shape is ISliceableShapeProvider)
            {
                ISliceableShapeProvider prov = shape as ISliceableShapeProvider;
                ISliceableSection       sec  = prov.GetSliceableShape();
                CompositeBeamSection    cs   = new CompositeBeamSection(sec, b_eff, h_solid, h_rib, F_y, fc_prime);
                phiM_n = cs.GetFlexuralStrength(SumQ_n);
            }
            else
            {
                if (shape is ISliceableSection)
                {
                    ISliceableSection    sec = shape as ISliceableSection;
                    CompositeBeamSection cs  = new CompositeBeamSection(sec, b_eff, h_solid, h_rib, F_y, fc_prime);
                    phiM_n = cs.GetFlexuralStrength(SumQ_n);
                }
                else
                {
                    throw new Exception("Shape type not supported. Please provide a shape object of standard geometry");
                }
            }
            return(phiM_n);
        }
        public double GetLowerBoundMomentOfInertia(sCrossSection cCheck, IFrameSet fs)
        {
            sKodeStructConverter kcon = new sKodeStructConverter();
            SteelMaterial        mat  = kcon.ToKodeStructMaterial_Steel(fs.crossSection);
            double I_LB   = 0;
            double b_eff  = this.GetBeamEffectiveSlabWidth(fs);
            double SumQ_n = this.GetSumOfStudsStrength(fs);
            // assuming,
            // Shear Stud Anchor
            // Light Weight Concrete : 4ksi
            // solid concrete thickness = 2.5"
            // rib thickness = 3"
            //
            double h_solid  = 2.5;
            double h_rib    = 3.0;
            double F_y      = mat.YieldStress; //?? unit ?? F_y of what??
            double fc_prime = 4.0;             //?? unit ??

            //check lowerBound Moment of Inertia by check section???
            ISection shape = kcon.ToKodeStructCrossSection(cCheck);

            if (shape is ISliceableShapeProvider)
            {
                ISliceableShapeProvider prov = shape as ISliceableShapeProvider;
                ISliceableSection       sec  = prov.GetSliceableShape();
                CompositeBeamSection    cs   = new CompositeBeamSection(sec, b_eff, h_solid, h_rib, F_y, fc_prime);
                I_LB = cs.GetLowerBoundMomentOfInertia(SumQ_n);
            }
            else
            {
                if (shape is ISliceableSection)
                {
                    ISliceableSection    sec = shape as ISliceableSection;
                    CompositeBeamSection cs  = new CompositeBeamSection(sec, b_eff, h_solid, h_rib, F_y, fc_prime);
                    I_LB = cs.GetLowerBoundMomentOfInertia(SumQ_n);
                }
                else
                {
                    throw new Exception("Shape type not supported. Please provide a shape object of standard geometry");
                }
            }



            return(I_LB);
        }
        public Curve ToRhinoCrosssectionProfile(sFrame sb, double t)
        {
            sCrossSection scs      = sb.crossSection;
            List <sXYZ>   vertice  = new List <sXYZ>();
            sPlane        secPlane = new sPlane(sb.axis.PointAt(t), sb.localPlane.Xaxis, sb.localPlane.Yaxis);

            if (scs.sectionType == eSectionType.AISC_I_BEAM)
            {
                vertice = scs.GetWbeamFaceVertices(secPlane).ToList();
            }
            else if (scs.sectionType == eSectionType.HSS_REC)
            {
                vertice = scs.GetHSSRecFaceVertices_Simple(secPlane);
            }
            else if (scs.sectionType == eSectionType.HSS_ROUND)
            {
                vertice = scs.GetHSSRoundFaceVertices_Simple(secPlane);
            }
            else if (scs.sectionType == eSectionType.RECTANGLAR)
            {
                vertice = scs.GetRecFaceVertices_Simple(secPlane);
            }
            else if (scs.sectionType == eSectionType.SQUARE)
            {
                vertice = scs.GetSquareFaceVertices_Simple(secPlane);
            }
            else if (scs.sectionType == eSectionType.ROUND)
            {
                vertice = scs.GetRoundFaceVertices_Simple(secPlane);
            }

            Polyline pl = new Polyline();

            for (int i = 0; i < vertice.Count; ++i)
            {
                pl.Add(this.ToRhinoPoint3d(vertice[i]));
            }
            pl.Add(this.ToRhinoPoint3d(vertice[0]));
            Curve profile = pl.ToNurbsCurve();

            return(profile);
        }
Пример #10
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string shapeName = "";

            if (!DA.GetData(0, ref shapeName))
            {
                return;
            }

            sCrossSection cs = new sCrossSection(shapeName);

            sMaterial mat = new sMaterial();

            mat.materialName = "Steel";
            mat.materialType = eMaterialType.STEEL_A36;
            cs.material      = mat;

            this.Message = cs.shapeName;

            DA.SetData(0, cs);
        }
Пример #11
0
        public static object Get_sRoundSection(sMaterial material, double diameter_in, double thickness_in = 0.0)
        {
            sCrossSection cs = new sCrossSection();

            eSectionType stype = eSectionType.ROUND;

            cs.sectionType = stype;

            string shapeN = "Round_" + diameter_in;

            if (thickness_in > 0.0)
            {
                shapeN += "x" + thickness_in;
            }

            cs.shapeName = shapeN;
            sDynamoConverter dycon = new sDynamoConverter("Feet", "Meters");

            diameter_in  /= 12.0;
            thickness_in /= 12.0;


            diameter_in  = Math.Round(diameter_in, 3);
            thickness_in = Math.Round(thickness_in, 3);

            cs.dimensions = new List <double>();
            cs.dimensions.Add(dycon.EnsureUnit_Dimension(diameter_in));
            if (thickness_in > 0.0)
            {
                cs.dimensions.Add(dycon.EnsureUnit_Dimension(thickness_in));
            }


            cs.material = material;

            return(new Dictionary <string, object>
            {
                { "sCrossSection", cs }
            });
        }
Пример #12
0
        internal Dyn.PolyCurve ToRhinoCrosssectionProfile(sFrame sb, double t)
        {
            sCrossSection scs      = sb.crossSection;
            List <sXYZ>   vertice  = new List <sXYZ>();
            sPlane        secPlane = new sPlane(sb.axis.PointAt(t), sb.localPlane.Xaxis, sb.localPlane.Yaxis);

            if (scs.sectionType == eSectionType.AISC_I_BEAM)
            {
                vertice = scs.GetWbeamFaceVertices(secPlane).ToList();
            }
            else if (scs.sectionType == eSectionType.HSS_REC)
            {
                vertice = scs.GetHSSRecFaceVertices_Simple(secPlane);
            }
            else if (scs.sectionType == eSectionType.HSS_ROUND)
            {
                vertice = scs.GetHSSRoundFaceVertices_Simple(secPlane);
            }
            else if (scs.sectionType == eSectionType.RECTANGLAR)
            {
                vertice = scs.GetRecFaceVertices_Simple(secPlane);
            }
            else if (scs.sectionType == eSectionType.SQUARE)
            {
                vertice = scs.GetSquareFaceVertices_Simple(secPlane);
            }
            else if (scs.sectionType == eSectionType.ROUND)
            {
                vertice = scs.GetRoundFaceVertices_Simple(secPlane);
            }

            List <Dyn.Point> dpts = new List <Autodesk.DesignScript.Geometry.Point>();

            for (int i = 0; i < vertice.Count; ++i)
            {
                dpts.Add(this.ToDynamoPoint(vertice[i]));
            }
            return(Dyn.PolyCurve.ByPoints(dpts, true));
        }
        public double GetFlexuralStrength_Vertical(sCrossSection section, eColorMode forceType)
        {
            sKodeStructConverter kcon = new sKodeStructConverter();
            SteelMaterial        mat  = kcon.ToKodeStructMaterial_Steel(section);

            string flexuralCompressional = "Top";
            string Code           = "AISC360-10";
            bool   IsRolledMember = true;
            double phiM_n         = 0;

            MomentAxis Axis = kcon.ToKodeStructMomentAxis(forceType);

            FlexuralCompressionFiberPosition FlexuralCompression;
            bool IsValidStringCompressionLoc = Enum.TryParse(flexuralCompressional, true, out FlexuralCompression);

            if (IsValidStringCompressionLoc == false)
            {
                throw new Exception("Flexural compression location selection not recognized. Check input string.");
            }

            ISection shape = kcon.ToKodeStructCrossSection(section);

            FlexuralMemberFactory factory = new FlexuralMemberFactory();
            ISteelBeamFlexure     beam    = factory.GetBeam(shape, mat, null, Axis, FlexuralCompression, IsRolledMember);

            SteelLimitStateValue Y = beam.GetFlexuralYieldingStrength(FlexuralCompression);

            phiM_n = Y.Value;

            if (Y.IsApplicable)
            {
                return(phiM_n);
            }
            else
            {
                return(-1);
            }
        }
        public SteelMaterial ToKodeStructMaterial_Steel(sCrossSection section, double Fy = -1)
        {
            double fy = 50;

            if (section.sectionType == eSectionType.AISC_I_BEAM)
            {
                fy = 50;
            }
            else if (section.sectionType == eSectionType.HSS_REC)
            {
                fy = 46;
            }
            else if (section.sectionType == eSectionType.HSS_ROUND)
            {
                fy = 42;
            }
            else if (section.sectionType == eSectionType.RECTANGLAR)
            {
                fy = 36;
            }
            else if (section.sectionType == eSectionType.ROUND)
            {
                fy = 36;
            }
            else if (section.sectionType == eSectionType.SQUARE)
            {
                fy = 36;
            }

            if (Fy > 0)
            {
                fy = Fy;
            }
            SteelMaterial mat = new SteelMaterial(fy, 29000);

            return(mat);
        }
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            sMaterial material  = null;
            double    width     = 0.0;
            double    depth     = 0.0;
            double    thickness = 0.0;

            if (!DA.GetData(0, ref material))
            {
                return;
            }
            if (!DA.GetData(1, ref width))
            {
                return;
            }
            if (!DA.GetData(2, ref depth))
            {
                return;
            }
            if (!DA.GetData(3, ref thickness))
            {
                return;
            }

            sCrossSection cs = new sCrossSection();

            string mss    = "";
            string shapeN = "";

            if (Math.Abs(width - depth) < 0.0001)
            {
                cs.sectionType = eSectionType.SQUARE;
                mss            = "Square: W" + width + ", D" + depth;
                shapeN        += "Square_" + width + "x" + depth;
            }
            else
            {
                cs.sectionType = eSectionType.RECTANGLAR;
                mss            = "Rectangular: W" + width + ", D" + depth;
                shapeN        += "Rectangular_" + width + "x" + depth;
            }

            if (thickness > 0.0)
            {
                mss    += ", Th " + thickness;
                shapeN += "x" + thickness;
            }
            cs.shapeName = shapeN;

            string          modelUnit = Rhino.RhinoDoc.ActiveDoc.ModelUnitSystem.ToString();
            sRhinoConverter rhcon     = new sRhinoConverter(modelUnit, "Meters");

            if (modelUnit == "Feet")
            {
                width     /= 12.0;
                depth     /= 12.0;
                thickness /= 12.0;
            }

            width     = Math.Round(width, 3);
            depth     = Math.Round(depth, 3);
            thickness = Math.Round(thickness, 3);

            cs.dimensions = new List <double>();
            cs.dimensions.Add(rhcon.EnsureUnit(width));
            cs.dimensions.Add(rhcon.EnsureUnit(depth));
            if (thickness > 0.0)
            {
                cs.dimensions.Add(rhcon.EnsureUnit(thickness));
            }

            cs.material = material;

            this.Message = mss;

            DA.SetData(0, cs);
        }