/***************************************************/

        public static oM.Physical.Constructions.Construction Construction(this string constructionName, string materialName)
        {
            if (string.IsNullOrEmpty(constructionName) || string.IsNullOrEmpty(materialName))
            {
                return(null);
            }

            string matName = null;

            if (!string.IsNullOrEmpty(materialName))
            {
                matName = string.Format("Default {0} Material", materialName);
            }
            else
            {
                matName = "Default Material";
            }

            SolidMaterial transparentMaterialProperties = new SolidMaterial();

            transparentMaterialProperties.Name = matName;

            oM.Physical.Materials.Material material = new oM.Physical.Materials.Material();
            material.Properties.Add(transparentMaterialProperties);

            oM.Physical.Constructions.Construction construction = new oM.Physical.Constructions.Construction();
            construction.Name = constructionName;

            oM.Physical.Constructions.Layer layer = new oM.Physical.Constructions.Layer();
            layer.Material = material;

            construction.Layers.Add(layer);

            return(construction);
        }
Exemple #2
0
        public static ConstantFramingProperty ConstantFramingProperty(ISectionProperty sectionProperty, double orientationAngle = 0, string name = "")
        {
            if (sectionProperty.IsNull())
            {
                return(null);
            }

            IProfile profile = null;

            if (sectionProperty is IGeometricalSection)
            {
                profile = (sectionProperty as IGeometricalSection).SectionProfile;
            }
            else
            {
                Reflection.Compute.RecordWarning("Was not able to extract any section profile.");
            }


            oM.Physical.Materials.Material material = null;

            if (sectionProperty.Material != null)
            {
                string matName = sectionProperty.Material.Name ?? "";
                material = Physical.Create.Material(matName, new List <oM.Physical.Materials.IMaterialProperties> {
                    sectionProperty.Material
                });
            }
            else
            {
                Reflection.Compute.RecordWarning("Material from SectionProperty of the Bar is null.");
            }

            name = string.IsNullOrEmpty(name) ? sectionProperty.Name : name;

            return(Physical.Create.ConstantFramingProperty(profile, material, orientationAngle, name));
        }
        /***************************************************/

        internal static void MaterialNotStructuralWarning(this oM.Physical.Materials.Material material)
        {
            BH.Engine.Reflection.Compute.RecordWarning(string.Format("The material does not contain any structural properties. BHoM Guid: {0}", material.BHoM_Guid));
        }
        /***************************************************/

        internal static void MaterialNotFoundWarning(this oM.Physical.Materials.Material material)
        {
            BH.Engine.Reflection.Compute.RecordWarning(string.Format("A Revit equivalent to the BHoM material has not been found. BHoM Guid: {0}", material.BHoM_Guid));
        }