Beispiel #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);
        }
Beispiel #2
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 }
            });
        }
Beispiel #3
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            sMaterial mat = new sMaterial(typicalName, matType);

            string mss = typicalName;

            if (matType == eMaterialType.OAK_TYP)
            {
                mss += "\nUse in Extra Cautious";
            }

            this.Message = mss;

            DA.SetData(0, mat);
        }
Beispiel #4
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 }
            });
        }
Beispiel #5
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);
        }
Beispiel #6
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 }
            });
        }
Beispiel #7
0
        public static object Get_sPresetMaterial(int materialType = 0)
        {
            string        typicalName = "Typical Steel" + "\nSteel A992 Fy50";
            eMaterialType matType     = eMaterialType.STEEL_A992_Fy50;

            if (materialType == 0)
            {
                matType     = eMaterialType.STEEL_A992_Fy50;
                typicalName = "Typical Steel" + "\nSteel A992 Fy50";
            }
            else if (materialType == 1)
            {
                matType     = eMaterialType.ALUMINUM_6061_T6;
                typicalName = "Typical Aluminum" + "\nAluminum 6061 T6";
            }
            else if (materialType == 2)
            {
                matType     = eMaterialType.CONCRETE_FC3000_NORMALWEIGHT;
                typicalName = "Typical Concrete" + "\nConcrete FC3000 NormalWeight";
            }
            else if (materialType == 3)
            {
                matType     = eMaterialType.OAK_TYP;
                typicalName = "Typical OAK";
            }
            else if (materialType == 4)
            {
                matType     = eMaterialType.CARBONFRP_TYP;
                typicalName = "Typical CarbonFRP";
            }
            else if (materialType == 5)
            {
                matType     = eMaterialType.STAINLESSSTEEL_TYP;
                typicalName = "Typical StainlessSteel";
            }
            else if (materialType == 6)
            {
                matType     = eMaterialType.STEEL_A36;
                typicalName = matType.ToString();
            }
            else if (materialType == 7)
            {
                matType     = eMaterialType.STEEL_A53GrB;
                typicalName = matType.ToString();
            }
            else if (materialType == 8)
            {
                matType     = eMaterialType.STEEL_A500GrB_Fy42;
                typicalName = matType.ToString();
            }
            else if (materialType == 9)
            {
                matType     = eMaterialType.STEEL_A500GrB_Fy46;
                typicalName = matType.ToString();
            }
            else if (materialType == 10)
            {
                matType     = eMaterialType.STEEL_A572Gr50;
                typicalName = matType.ToString();
            }
            else if (materialType == 11)
            {
                matType     = eMaterialType.STEEL_A913Gr50;
                typicalName = matType.ToString();
            }
            else if (materialType == 12)
            {
                matType     = eMaterialType.STEEL_A992_Fy50;
                typicalName = matType.ToString();
            }
            else if (materialType == 13)
            {
                matType     = eMaterialType.CONCRETE_FC3000_NORMALWEIGHT;
                typicalName = matType.ToString();
            }
            else if (materialType == 14)
            {
                matType     = eMaterialType.CONCRETE_FC4000_NORMALWEIGHT;
                typicalName = matType.ToString();
            }
            else if (materialType == 15)
            {
                matType     = eMaterialType.CONCRETE_FC5000_NORMALWEIGHT;
                typicalName = matType.ToString();
            }
            else if (materialType == 16)
            {
                matType     = eMaterialType.CONCRETE_FC6000_NORMALWEIGHT;
                typicalName = matType.ToString();
            }
            else if (materialType == 17)
            {
                matType     = eMaterialType.CONCRETE_FC3000_LIGHTWEIGHT;
                typicalName = matType.ToString();
            }
            else if (materialType == 18)
            {
                matType     = eMaterialType.CONCRETE_FC4000_LIGHTWEIGHT;
                typicalName = matType.ToString();
            }
            else if (materialType == 19)
            {
                matType     = eMaterialType.CONCRETE_FC5000_LIGHTWEIGHT;
                typicalName = matType.ToString();
            }
            else if (materialType == 20)
            {
                matType     = eMaterialType.CONCRETE_FC6000_LIGHTWEIGHT;
                typicalName = matType.ToString();
            }
            else if (materialType == 21)
            {
                matType     = eMaterialType.ALUMINUM_6061_T6;
                typicalName = matType.ToString();
            }
            else if (materialType == 22)
            {
                matType     = eMaterialType.ALUMINUM_6063_T6;
                typicalName = matType.ToString();
            }
            else if (materialType == 23)
            {
                matType     = eMaterialType.ALUMINUM_5052_H34;
                typicalName = matType.ToString();
            }
            else if (materialType == 24)
            {
                matType     = eMaterialType.COLDFORMED_Grade_33;
                typicalName = matType.ToString();
            }
            else if (materialType == 25)
            {
                matType     = eMaterialType.COLDFORMED_Grade_50;
                typicalName = matType.ToString();
            }

            sMaterial mat = new sMaterial(typicalName, matType);

            string mss = typicalName;

            if (matType == eMaterialType.OAK_TYP)
            {
                mss += "\nUse in Extra Cautious";
            }

            //add more...

            return(new Dictionary <string, object>
            {
                { "materialName", mss },
                { "sMaterial", 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);
        }