Esempio n. 1
0
        private void AddchsCSS(KarambaIDEA.Core.CrossSection crossSection)
        {
            CrossSectionParameter chs = new CrossSectionParameter();

            chs.Id = crossSection.id;
            MatSteel material = openModel.MatSteel.First(a => a.Id == crossSection.material.id);

            chs.Material = new ReferenceElement(material);
            chs.Name     = crossSection.name;
            double height  = crossSection.height / 1000 / 2; //adjust to radius
            double width   = crossSection.width / 1000;
            double tweb    = crossSection.thicknessWeb / 1000;
            double tflange = crossSection.thicknessFlange / 1000;
            double radius  = crossSection.radius / 1000;

            //CrossSectionFactory.FillCssRectangleHollow(hollow, width, height, tweb, tweb, tflange, tflange);
            CrossSectionFactory.FillOHollow(chs, height, tweb);
            //height
            //width
            //thickness
            //innerradius
            //outerradius
            //unkown
            //CrossSectionFactory.FillCssSteelChannel(hollow, height, width, tweb, tflange, radius, radius, 0);

            openModel.AddObject(chs);
        }
        /// <summary>
        /// Add cross section to the IDEA open model
        /// </summary>
        /// <param name="model">Open model</param>
        private static void AddCrossSectionToIOM(OpenModel model)
        {
            // only one material is in the model
            MatSteel material = model.MatSteel.FirstOrDefault();

            // create first cross section
            CrossSectionParameter css1 = Helpers.CreateCSSParameter(1, "HE200B", material);

            // create second cross section
            CrossSectionParameter css2 = Helpers.CreateCSSParameter(2, "HE240B", material);

            // add cross sections to the model
            model.AddObject(css1);
            model.AddObject(css2);
        }
Esempio n. 3
0
        /// <summary>
        /// Create cross section
        /// </summary>
        /// <param name="id">Css id</param>
        /// <param name="name">Name of css</param>
        /// <param name="material">Material of css</param>
        /// <returns>CSS with appropriate id, name and material</returns>
        public static CrossSectionParameter CreateCSSParameter(int id, string name, MatSteel material)
        {
            CrossSectionParameter css = new CrossSectionParameter();

            css.Id   = id;
            css.Name = name;
            css.CrossSectionRotation = 0;
            css.CrossSectionType     = CrossSectionType.RolledI;

            css.Parameters.Add(new ParameterString()
            {
                Name = "UniqueName", Value = name
            });
            css.Material = new ReferenceElement(material);

            return(css);
        }
Esempio n. 4
0
        private void AddRolledCSS(KarambaIDEA.Core.CrossSection crossSection)
        {
            CrossSectionParameter crossSectionParameter = new CrossSectionParameter();

            crossSectionParameter.Id = crossSection.id;
            //find related material:
            MatSteel material = openModel.MatSteel.First(a => a.Id == crossSection.material.id);

            crossSectionParameter.Material = new ReferenceElement(material);
            //set cross section type
            crossSectionParameter.CrossSectionType = CrossSectionType.RolledI;
            crossSectionParameter.Name             = crossSection.name;
            crossSectionParameter.Parameters.Add(new ParameterString()
            {
                Name = "UniqueName", Value = crossSection.name
            });
            openModel.AddObject(crossSectionParameter);
        }