示例#1
0
        public bool Equals(Material m)
        {
            if ((object)m == null)
                return false;

            return this.Name.Equals(m.Name, StringComparison.CurrentCultureIgnoreCase);
        }
示例#2
0
        /// <summary>
        /// Initialise a new material
        /// </summary>
        /// <param name="MaterialName">The name of the material to initialise</param>
        /// <returns>The new material</returns>
        private Material GetMaterial(string MaterialName)
        {
            Material newMaterial;

            newMaterial = new Material(MaterialName);

            dynamic elasticity = 0.0;
            dynamic poisson = 0.0;
            dynamic density = 0.0;
            dynamic alpha = 0.0;
            dynamic damping = 0.0;
            this.Staad.Property.GetMaterialProperty(newMaterial.Name, ref elasticity, ref poisson, ref density, ref alpha, ref damping);
            newMaterial.Elasticity = elasticity;
            newMaterial.Poisson = poisson;
            newMaterial.Density = density;
            newMaterial.Alpha = alpha;
            newMaterial.Damping = damping;

            // assign the material to the correct beams
            dynamic ids = new int[(int)this.Staad.Property.GetIsotropicMaterialAssignedBeamCount(newMaterial.Name)];
            this.Staad.Property.GetIsotropicMaterialAssignedBeamList(newMaterial.Name, ref ids);
            this.Beams.Where(o => ((int[])ids).Contains(o.ID)).ToList().ForEach(o => o.Material = newMaterial);

            return newMaterial;
        }