Esempio n. 1
0
        private List <Curve> CreateFromEachColumnKind(string idSection, StbColumnKind_structure kind, IReadOnlyList <Point3d> sectionPoints)
        {
            List <Curve> curveList;

            switch (kind)
            {
            case StbColumnKind_structure.RC:
                StbSecColumn_RC rcSec = _sections.StbSecColumn_RC.First(sec => sec.id == idSection);
                curveList = SecRcColumnToCurves(rcSec.StbSecFigureColumn_RC.Item, sectionPoints);
                break;

            case StbColumnKind_structure.S:
                StbSecColumn_S sSec = _sections.StbSecColumn_S.First(sec => sec.id == idSection);
                curveList = SecSteelColumnToCurves(sSec.StbSecSteelFigureColumn_S.Items, sectionPoints);
                break;

            case StbColumnKind_structure.SRC:
                StbSecColumn_SRC srcSec = _sections.StbSecColumn_SRC.First(sec => sec.id == idSection);
                curveList = SecRcColumnToCurves(srcSec.StbSecFigureColumn_SRC.Item, sectionPoints);
                break;

            case StbColumnKind_structure.CFT:
            case StbColumnKind_structure.UNDEFINED:
                throw new ArgumentException("Unsupported StbColumnKind");

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(curveList);
        }
Esempio n. 2
0
        private static GH_Structure <GH_String> GetTagStrings(IEnumerable <StbPost> columns, StbSections sections)
        {
            var ghSecStrings = new GH_Structure <GH_String>();

            foreach (var item in columns.Select((column, index) => new { column, index }))
            {
                string secId  = item.column.id_section;
                var    ghPath = new GH_Path(0, item.index);
                StbColumnKind_structure kindStruct = item.column.kind_structure;

                switch (kindStruct)
                {
                case StbColumnKind_structure.RC:
                    StbSecColumn_RC secRc = sections.StbSecColumn_RC.First(i => i.id == secId);
                    ghSecStrings.AppendRange(TagUtils.GetColumnRcSection(secRc.StbSecFigureColumn_RC.Item, secRc.strength_concrete), ghPath);
                    break;

                case StbColumnKind_structure.S:
                    StbSecColumn_S secS = sections.StbSecColumn_S.First(i => i.id == secId);
                    foreach (object figureObj in secS.StbSecSteelFigureColumn_S.Items)
                    {
                        ghSecStrings.AppendRange(TagUtils.GetColumnSSection(figureObj), ghPath);
                    }
                    break;

                case StbColumnKind_structure.SRC:
                    StbSecColumn_SRC secSrc = sections.StbSecColumn_SRC.First(i => i.id == secId);
                    ghSecStrings.AppendRange(TagUtils.GetColumnRcSection(secSrc.StbSecFigureColumn_SRC.Item, secSrc.strength_concrete), ghPath);
                    foreach (object figureObj in secSrc.StbSecSteelFigureColumn_SRC.Items)
                    {
                        ghSecStrings.AppendRange(TagUtils.GetColumnSSection(figureObj), ghPath);
                    }
                    break;

                case StbColumnKind_structure.CFT:
                case StbColumnKind_structure.UNDEFINED:
                    throw new ArgumentException("Unsupported section type.");

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }

            return(ghSecStrings);
        }