Exemple #1
0
        private IMaterialFragment GetBrickPropertyMaterial(int brickProp)
        {
            int err = 0;
            IMaterialFragment material = null;

            double[]      materialArray = new double[8];
            int           materialType  = 0;
            StringBuilder materialName  = new StringBuilder(St7.kMaxStrLen);

            err = St7.St7GetBrickPropertyType(1, brickProp, ref materialType);
            if (materialType != St7.mtIsotropic)
            {
                return(material);                                   // !!! ISOTROPIC ONLY !!!
            }
            err = St7.St7GetBrickIsotropicMaterial(1, brickProp, materialArray);
            if (!St7Error(err))
            {
                return(material);
            }
            err = St7.St7GetMaterialName(1, St7.ptBRICKPROP, brickProp, materialName, St7.kMaxStrLen);
            // !!!! Materials are set based on Poisson Ratio !!!!
            if (materialArray[St7.ipBeamPoisson] <= 0.2)
            {
                material = BH.Engine.Structure.Create.Concrete(materialName.ToString(), materialArray[St7.ipBrickIsoModulus], materialArray[St7.ipBrickIsoPoisson], materialArray[St7.ipBrickIsoAlpha], materialArray[St7.ipBrickIsoDensity]);
            }
            else
            {
                material = BH.Engine.Structure.Create.Steel(materialName.ToString(), materialArray[St7.ipBrickIsoModulus], materialArray[St7.ipBrickIsoPoisson], materialArray[St7.ipBrickIsoAlpha], materialArray[St7.ipBrickIsoDensity]);
            }
            return(material);
        }