Exemple #1
0
        /// <summary>
        /// Factories the specified application.
        /// </summary>
        /// <param name="app">The application.</param>
        /// <param name="uniqueName">Name of the unique.</param>
        /// <returns>ColdFormed.</returns>
        internal new static ColdFormed Factory(ApiCSiApplication app, string uniqueName, double temperature = 0)
        {
            ColdFormed material = new ColdFormed(app, uniqueName, temperature);

            material.FillData();

            return(material);
        }
        /// <summary>
        /// Returns a new material class.
        /// </summary>
        /// <param name="name">Unique material name.</param>
        /// <returns>Steel.</returns>
        public static Material Factory(string name)
        {
            if (Registry.Materials.Keys.Contains(name))
            {
                return(Registry.Materials[name]);
            }

            Tuple <eMaterialPropertyType, eMaterialSymmetryType> materialTypes = GetMaterialType(name);

            Material material;

            switch (materialTypes.Item1)
            {
            case eMaterialPropertyType.Steel:
                material = Steel.Factory(name);
                break;

            case eMaterialPropertyType.Concrete:
                material = Concrete.Factory(name);
                break;

            case eMaterialPropertyType.Masonry:
                material = Masonry.Factory(name);
                break;

            case eMaterialPropertyType.Tendon:
                material = TendonMaterial.Factory(name);
                break;

            case eMaterialPropertyType.Rebar:
                material = Rebar.Factory(name);
                break;

#if !BUILD_ETABS2015 && !BUILD_ETABS2016 && !BUILD_ETABS2017
            case eMaterialPropertyType.Aluminum:
                material = Aluminum.Factory(name, app);
                break;

            case eMaterialPropertyType.ColdFormed:
                material = ColdFormed.Factory(name, app);
                break;
#endif
            case eMaterialPropertyType.NoDesign:
                return(null);

            default:
                return(null);
            }

            Registry.Materials.Add(name, material);
            return(material);
        }
Exemple #3
0
        public new static ColdFormed Factory(string uniqueName)
        {
            if (Registry.Materials.Keys.Contains(uniqueName))
            {
                return((ColdFormed)Registry.Materials[uniqueName]);
            }

            ColdFormed material = new ColdFormed(uniqueName);

            if (_materialProperties != null)
            {
                material.FillData();
            }
            Registry.Materials.Add(uniqueName, material);
            return(material);
        }