private List <Curve> CreateFromEachGirderKind(string idSection, StbGirderKind_structure kind, IReadOnlyList <Point3d> sectionPoints) { List <Curve> curveList; switch (kind) { case StbGirderKind_structure.RC: StbSecBeam_RC rcSec = _sections.StbSecBeam_RC.First(sec => sec.id == idSection); object[] rcFigure = rcSec.StbSecFigureBeam_RC.Items; curveList = SecRcBeamCurves(rcFigure, sectionPoints); break; case StbGirderKind_structure.S: StbSecBeam_S sSec = _sections.StbSecBeam_S.First(sec => sec.id == idSection); object[] sFigure = sSec.StbSecSteelFigureBeam_S.Items; curveList = SecSteelBeamToCurves(sFigure, sectionPoints); break; case StbGirderKind_structure.SRC: StbSecBeam_SRC srcSec = _sections.StbSecBeam_SRC.First(sec => sec.id == idSection); object[] srcFigure = srcSec.StbSecFigureBeam_SRC.Items; curveList = SecSrcBeamCurves(srcFigure, sectionPoints); break; case StbGirderKind_structure.UNDEFINED: default: throw new ArgumentOutOfRangeException(); } return(curveList); }
private static GH_Structure <GH_String> GetTagStrings(IEnumerable <StbBeam> beams, StbSections sections) { var ghSecStrings = new GH_Structure <GH_String>(); foreach (var item in beams.Select((beam, index) => new { beam, index })) { string secId = item.beam.id_section; var ghPath = new GH_Path(0, item.index); StbGirderKind_structure kindStruct = item.beam.kind_structure; switch (kindStruct) { case StbGirderKind_structure.RC: StbSecBeam_RC secRc = sections.StbSecBeam_RC.First(i => i.id == secId); foreach (object figureObj in secRc.StbSecFigureBeam_RC.Items) { ghSecStrings.AppendRange(TagUtils.GetBeamRcSection(figureObj, secRc.strength_concrete), ghPath); } break; case StbGirderKind_structure.S: StbSecBeam_S secS = sections.StbSecBeam_S.First(i => i.id == secId); foreach (object figureObj in secS.StbSecSteelFigureBeam_S.Items) { ghSecStrings.AppendRange(TagUtils.GetBeamSSection(figureObj), ghPath); } break; case StbGirderKind_structure.SRC: StbSecBeam_SRC secSrc = sections.StbSecBeam_SRC.First(i => i.id == secId); foreach (object figureObj in secSrc.StbSecFigureBeam_SRC.Items) { ghSecStrings.AppendRange(TagUtils.GetBeamRcSection(figureObj, secSrc.strength_concrete), ghPath); } foreach (object figureObj in secSrc.StbSecSteelFigureBeam_SRC.Items) { ghSecStrings.AppendRange(TagUtils.GetBeamSSection(figureObj), ghPath); } break; case StbGirderKind_structure.UNDEFINED: break; default: throw new ArgumentOutOfRangeException(); } } return(ghSecStrings); }