Beispiel #1
0
        private IMaterialFragment GetBeamPropertyMaterial(int beamProp)
        {
            int err = 0;
            IMaterialFragment material = null;

            double[]      materialArray = new double[9];
            StringBuilder materialName  = new StringBuilder(St7.kMaxStrLen);

            err = St7.St7GetBeamMaterialData(1, beamProp, materialArray);
            if (!St7Error(err))
            {
                return(material);
            }
            err = St7.St7GetMaterialName(1, St7.ptBEAMPROP, beamProp, materialName, St7.kMaxStrLen);
            if (!St7Error(err))
            {
                return(material);
            }
            // !!!! Materials are set based on Poisson Ratio !!!!
            if (materialArray[St7.ipBeamPoisson] <= 0.2)
            {
                material = BH.Engine.Structure.Create.Concrete(materialName.ToString(), materialArray[St7.ipBeamModulus], materialArray[St7.ipBeamPoisson], materialArray[St7.ipBeamAlpha], materialArray[St7.ipBeamDensity]);
            }
            else
            {
                material = BH.Engine.Structure.Create.Steel(materialName.ToString(), materialArray[St7.ipBeamModulus], materialArray[St7.ipBeamPoisson], materialArray[St7.ipBeamAlpha], materialArray[St7.ipBeamDensity]);
            }
            return(material);
        }