Example #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);
        }
Example #2
0
        private void AddCrossSectionToOpenModel(KarambaIDEA.Core.CrossSection crossSection)
        {
            switch (crossSection.shape)
            {
            case KarambaIDEA.Core.CrossSection.Shape.ISection:
            {
                AddRolledCSS(crossSection);
                return;
            }

            case KarambaIDEA.Core.CrossSection.Shape.HollowSection:
            {
                AddHollowCSS(crossSection);
                return;
            }

            case KarambaIDEA.Core.CrossSection.Shape.CHSsection:
            {
                AddchsCSS(crossSection);
                return;
            }

            default:
            {
                throw new NotImplementedException();
            }
            }
        }
Example #3
0
        /// <summary>
        /// Create crosssection only if the cross-section does not exist yet in the project
        /// </summary>
        /// <param name="_project"></param>
        /// <param name="_name"></param>
        /// <param name="_shape"></param>
        /// <param name="_material"></param>
        /// <param name="_height"></param>
        /// <param name="_width"></param>
        /// <param name="_thicknessFlange"></param>
        /// <param name="_thicknessWeb"></param>
        /// <param name="_radius"></param>
        /// <returns></returns>
        public static CrossSection CreateNewOrExisting(Project _project, string _name, Shape _shape, MaterialSteel _material, double _height, double _width, double _thicknessFlange, double _thicknessWeb, double _radius)
        {
            double       tol = Project.tolerance;
            CrossSection p   = _project.crossSections.Where(a => a.name == _name && a.material == _material).FirstOrDefault();

            if (p == null)
            {
                p = new CrossSection(_project, _name, _shape, _material, _height, _width, _thicknessFlange, _thicknessWeb, _radius);
            }
            return(p);
        }
Example #4
0
        public ElementRAZ(Project _project, int _id, LineRAZ _line, CrossSection _crossSection, string _groupname, int _numberInHierarchy)

        {
            this.project = _project;
            _project.elementRAZs.Add(this);
            this.id                = _id;
            this.line              = _line;
            this.crossSection      = _crossSection;
            this.groupname         = _groupname;
            this.numberInHierarchy = _numberInHierarchy;
        }
Example #5
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);
        }