private static void SetSectionInfo(StbSections sections, GH_Structure <GH_String> ghSecStrings, StbSlab slab, int index) { string secId = slab.id_section; var ghPath = new GH_Path(0, index); StbSlabKind_structure kindStruct = slab.kind_structure; switch (kindStruct) { case StbSlabKind_structure.RC: StbSecSlab_RC secRc = sections.StbSecSlab_RC.First(i => i.id == secId); foreach (object figure in secRc.StbSecFigureSlab_RC.Items) { ghSecStrings.AppendRange(TagUtils.GetSlabRcSection(figure, secRc.strength_concrete), ghPath); } break; case StbSlabKind_structure.DECK: StbSecSlabDeck secDeck = sections.StbSecSlabDeck.First(i => i.id == secId); ghSecStrings.AppendRange(TagUtils.GetSlabDeckSection(secDeck.StbSecFigureSlabDeck.StbSecSlabDeckStraight, secDeck.strength_concrete), ghPath); break; case StbSlabKind_structure.PRECAST: StbSecSlabPrecast secPrecast = sections.StbSecSlabPrecast.First(i => i.id == secId); ghSecStrings.AppendRange(TagUtils.GetSlabPrecastSection(secPrecast.precast_type, secPrecast.StbSecProductSlabPrecast, secPrecast.strength_concrete), ghPath); break; default: throw new ArgumentOutOfRangeException(nameof(kindStruct), kindStruct, null); } }
private static void SetFlatBarSection(StbSections sections, FemMaterial material, CroSecFamilyName familyName, ICollection <CroSec> k3dCroSecList) { if (sections.StbSecSteel.StbSecFlatBar != null) { foreach (StbSecFlatBar flatBar in sections.StbSecSteel.StbSecFlatBar) { var k3dCroSec = new CroSec_Trapezoid(familyName.FB, flatBar.name, null, null, material, flatBar.B, flatBar.t, flatBar.t); SetK3dCroSecElemId(sections, k3dCroSec, flatBar.name); k3dCroSecList.Add(k3dCroSec); } } }
private static void SetPipeSection(StbSections sections, FemMaterial material, CroSecFamilyName familyName, ICollection <CroSec> k3dCroSecList) { if (sections.StbSecSteel.StbSecPipe != null) { foreach (StbSecPipe pipe in sections.StbSecSteel.StbSecPipe) { var k3dCroSec = new CroSec_Circle(familyName.Circle, pipe.name, null, null, material, pipe.D / 10d, pipe.t / 10d); SetK3dCroSecElemId(sections, k3dCroSec, pipe.name); k3dCroSecList.Add(k3dCroSec); } } }
private static void SetBuildHSection(StbSections sections, FemMaterial material, CroSecFamilyName familyName, ICollection <CroSec> k3dCroSecList) { if (sections.StbSecSteel.StbSecBuildH != null) { foreach (StbSecBuildH buildH in sections.StbSecSteel.StbSecBuildH) { var k3dCroSec = new CroSec_I(familyName.H, buildH.name, null, null, material, buildH.A / 10d, buildH.B / 10d, buildH.B / 10d, buildH.t2 / 10d, buildH.t2 / 10d, buildH.t1 / 10d); SetK3dCroSecElemId(sections, k3dCroSec, buildH.name); k3dCroSecList.Add(k3dCroSec); } } }
private static void SetRollBoxSection(StbSections sections, FemMaterial material, CroSecFamilyName familyName, ICollection <CroSec> k3dCroSecList) { if (sections.StbSecSteel.StbSecRollBOX != null) { foreach (StbSecRollBOX rollBOX in sections.StbSecSteel.StbSecRollBOX) { var k3dCroSec = new CroSec_Box(familyName.Box, rollBOX.name, null, null, material, rollBOX.A / 10d, rollBOX.B / 10d, rollBOX.B / 10d, rollBOX.t / 10d, rollBOX.t / 10d, rollBOX.t / 10d, rollBOX.r / 10d, rollBOX.r / 10d); SetK3dCroSecElemId(sections, k3dCroSec, rollBOX.name); k3dCroSecList.Add(k3dCroSec); } } }
private static void SetBuildBoxSection(StbSections sections, FemMaterial material, CroSecFamilyName familyName, ICollection <CroSec> k3dCroSecList) { if (sections.StbSecSteel.StbSecBuildBOX != null) { foreach (StbSecBuildBOX buildBOX in sections.StbSecSteel.StbSecBuildBOX) { var k3dCroSec = new CroSec_Box(familyName.Box, buildBOX.name, null, null, material, buildBOX.A / 10d, buildBOX.B / 10d, buildBOX.B / 10d, buildBOX.t2 / 10d, buildBOX.t2 / 10d, buildBOX.t1 / 10d, 0, -1); SetK3dCroSecElemId(sections, k3dCroSec, buildBOX.name); k3dCroSecList.Add(k3dCroSec); } } }
private static void SetRollTSection(StbSections sections, FemMaterial material, CroSecFamilyName familyName, ICollection <CroSec> k3dCroSecList) { if (sections.StbSecSteel.StbSecRollT != null) { foreach (StbSecRollT rollT in sections.StbSecSteel.StbSecRollT) { var k3dCroSec = new CroSec_T(familyName.T, rollT.name, null, null, material, rollT.A / 10d, rollT.B / 10d, rollT.t2 / 10d, rollT.t1 / 10d, rollT.r / 10d, rollT.r / 10d); SetK3dCroSecElemId(sections, k3dCroSec, rollT.name); k3dCroSecList.Add(k3dCroSec); } } }
private static void SetRoundBarSection(StbSections sections, FemMaterial material, CroSecFamilyName familyName, ICollection <CroSec> k3dCroSecList) { if (sections.StbSecSteel.StbSecRoundBar != null) { foreach (StbSecRoundBar roundBar in sections.StbSecSteel.StbSecRoundBar) { // TODO: Karambaは中実円断面ないため、矩形の等価断面。 double eqLength = Math.Sqrt(roundBar.R * roundBar.R * Math.PI) / 10d; var k3dCroSec = new CroSec_Trapezoid(familyName.Circle, roundBar.name, null, null, material, eqLength, eqLength, eqLength); SetK3dCroSecElemId(sections, k3dCroSec, roundBar.name); k3dCroSecList.Add(k3dCroSec); } } }
private static void SetRollLSection(StbSections sections, FemMaterial material, CroSecFamilyName familyName, ICollection <CroSec> k3dCroSecList) { if (sections.StbSecSteel.StbSecRollL != null) { foreach (StbSecRollL rollL in sections.StbSecSteel.StbSecRollL) { // TODO: 正確な形状に合わせて等価断面計算する。フィレットは非考慮 int typeFactor = rollL.type == StbSecRollLType.SINGLE ? 1 : 2; var eqLength = Math.Sqrt((rollL.A * rollL.t1 + rollL.B * rollL.t2 - rollL.t1 * rollL.t2) * typeFactor) / 10d; var k3dCroSec = new CroSec_Trapezoid(familyName.Circle, rollL.name, null, null, material, eqLength, eqLength, eqLength); SetK3dCroSecElemId(sections, k3dCroSec, rollL.name); k3dCroSecList.Add(k3dCroSec); } } }
private static void SetLipCSection(StbSections sections, FemMaterial material, CroSecFamilyName familyName, ICollection <CroSec> k3dCroSecList) { if (sections.StbSecSteel.StbSecLipC != null) { foreach (StbSecLipC lipC in sections.StbSecSteel.StbSecLipC) { // TODO: 正確な形状に合わせて等価断面計算する。フィレットは非考慮 int typeFactor = lipC.type == StbSecLipCType.SINGLE ? 1 : 2; var eqLength = Math.Sqrt((2 * lipC.A * lipC.t + lipC.H * lipC.t + 2 * lipC.C * lipC.t - 4 * lipC.t * lipC.t) * typeFactor) / 10d; var k3dCroSec = new CroSec_Trapezoid(familyName.Circle, lipC.name, null, null, material, eqLength, eqLength, eqLength); SetK3dCroSecElemId(sections, k3dCroSec, lipC.name); k3dCroSecList.Add(k3dCroSec); } } }
public StbModel SetByAngle(double colMaxAngle) { // TODO: リストが大量にあるの直す var columns = new List <StbColumn>(); var girders = new List <StbGirder>(); var braces = new List <StbBrace>(); var secBeams_S = new List <StbSecBeam_S>(); var secBeams_Rc = new List <StbSecBeam_RC>(); var secColumn_S = new List <StbSecColumn_S>(); var secColumn_Rc = new List <StbSecColumn_RC>(); var secBrace_S = new List <StbSecBrace_S>(); var secSteel = new K2SSecSteelItems(); foreach (ModelElement elem in _kModel.elems) { if (!(elem is ModelElementStraightLine)) { continue; } Karamba.Geometry.Point3 to = _kModel.nodes[elem.node_inds[0]].pos; Karamba.Geometry.Point3 from = _kModel.nodes[elem.node_inds[1]].pos; var elemLine = new Line(new Point3d(to.X, to.Y, to.Z), new Point3d(from.X, from.Y, from.Z)); double pAngle = Vector3d.VectorAngle(elemLine.Direction, Vector3d.ZAxis); double nAngle = Vector3d.VectorAngle(elemLine.Direction, -Vector3d.ZAxis); switch (elem) { case ModelBeam modelBeam: ModelBeamToStbColumnAndGirder(secBeams_Rc, secBeams_S, secColumn_Rc, secColumn_S, secSteel, colMaxAngle, columns, girders, pAngle, nAngle, modelBeam); break; case ModelTruss modelTruss: ModelTrussToStbBrace(secBrace_S, secSteel, braces, modelTruss); break; default: throw new ArgumentException("Karamba3D model parse error."); } } StbMembers members = BindMemberProps(columns, girders, braces); StbSections sections = BindSectionProps(secBeams_S, secBeams_Rc, secColumn_S, secColumn_Rc, secBrace_S, secSteel); return(new StbModel() { StbNodes = _kModel.nodes.ToStb(), StbMembers = members, StbSections = sections }); }
public static List <CroSec> GetCroSec(StbSections sections, CroSecFamilyName familyName) { // TODO: 材軸の回転は未設定 var k3dCroSec = new List <CroSec>(); #if karamba1 var sn400 = new FemMaterial_Isotrop("Steel", "SN400", 20500_0000, 8076_0000, 8076_0000, 78.5, 23_5000, 1.20E-05, Color.Brown); #elif karamba2 var sn400 = new FemMaterial_Isotrop("Steel", "SN400", 20500_0000, 8076_0000, 8076_0000, 78.5, 23_5000, 23_5000, FemMaterial.FlowHypothesis.mises, 1.20E-05, Color.Brown); #endif k3dCroSec.AddRange(StbSecColumnRcToK3dCroSec(sections.StbSecColumn_RC)); k3dCroSec.AddRange(StbSecBeamRcToK3dCroSec(sections.StbSecBeam_RC)); k3dCroSec.AddRange(StbSecSteelToK3dCroSec(sections, sn400, familyName)); return(k3dCroSec); }
public static double GetDepth(StbSections sections, StbSlab slab) { double depth = 0; switch (slab.kind_structure) { case StbSlabKind_structure.RC: object[] slabRc = sections.StbSecSlab_RC.First(sec => sec.id == slab.id_section).StbSecFigureSlab_RC.Items; switch (slabRc.Length) { case 1: var straight = slabRc[0] as StbSecSlab_RC_Straight; depth = straight.depth; break; case 2: var tapers = new[] { slabRc[0] as StbSecSlab_RC_Taper, slabRc[1] as StbSecSlab_RC_Taper }; depth = tapers.First(sec => sec.pos == StbSecSlab_RC_TaperPos.TIP).depth; break; case 3: var haunches = new[] { slabRc[0] as StbSecSlab_RC_Haunch, slabRc[1] as StbSecSlab_RC_Haunch, slabRc[2] as StbSecSlab_RC_Haunch }; depth = haunches.First(sec => sec.pos == StbSecSlab_RC_HaunchPos.CENTER).depth; break; } break; case StbSlabKind_structure.DECK: depth = sections.StbSecSlabDeck.FirstOrDefault(sec => sec.id == slab.id_section).StbSecFigureSlabDeck.StbSecSlabDeckStraight.depth; break; case StbSlabKind_structure.PRECAST: depth = sections.StbSecSlabPrecast.FirstOrDefault(sec => sec.id == slab.id_section).StbSecFigureSlabPrecast.StbSecSlabPrecastStraight.depth_concrete; break; default: throw new ArgumentOutOfRangeException(); } return(depth); }
private static List <CroSec> StbSecSteelToK3dCroSec(StbSections sections, FemMaterial material, CroSecFamilyName familyName) { var k3dCroSecList = new List <CroSec>(); if (sections.StbSecSteel == null) { return(k3dCroSecList); } SetRollHSection(sections, material, familyName, k3dCroSecList); SetBuildHSection(sections, material, familyName, k3dCroSecList); SetRollBoxSection(sections, material, familyName, k3dCroSecList); SetBuildBoxSection(sections, material, familyName, k3dCroSecList); SetRollTSection(sections, material, familyName, k3dCroSecList); SetPipeSection(sections, material, familyName, k3dCroSecList); SetRollCSection(sections, material, familyName, k3dCroSecList); SetRollLSection(sections, material, familyName, k3dCroSecList); SetLipCSection(sections, material, familyName, k3dCroSecList); SetFlatBarSection(sections, material, familyName, k3dCroSecList); SetRoundBarSection(sections, material, familyName, k3dCroSecList); return(k3dCroSecList); }
public static Dictionary <string, string>[][] GetAllSectionInfoArray(StbMembers members, StbSections sections) { var allTagList = new Dictionary <string, string> [7][]; var memberArray = new object[][] { members.StbColumns, members.StbGirders, members.StbPosts, members.StbBeams, members.StbBraces, members.StbSlabs, members.StbWalls }; for (var i = 0; i < 7; i++) { allTagList[i] = memberArray[i] != null?StbMembersToDictArray(memberArray[i], sections) : Array.Empty <Dictionary <string, string> >(); } return(allTagList); }
private static Dictionary <string, string> GetMemberInfoDictionary(Type type, object member, StbSections sections) { PropertyInfo[] props = type.GetProperties(); var instanceProps = new Dictionary <string, string> { { "stb_element_type", type.Name } }; foreach (PropertyInfo prop in props) { if (prop.GetValue(member) == null) { continue; } try { instanceProps.Add(prop.Name, prop.GetValue(member).ToString()); } catch { // ignored } } AppendSectionInfos(instanceProps, sections); return(instanceProps); }
private static void AppendSectionInfos(IDictionary <string, string> pDict, StbSections sections) { var sectionInfo = new List <GH_String>(); switch (pDict["stb_element_type"]) { case "StbColumn": case "StbPost": switch (pDict["kind_structure"]) { case "RC": StbSecColumn_RC columnRc = sections.StbSecColumn_RC.First(sec => sec.id == pDict["id_section"]); sectionInfo = GetColumnRcSection(columnRc.StbSecFigureColumn_RC.Item, columnRc.strength_concrete).ToList(); break; case "SRC": StbSecColumn_SRC columnSrc = sections.StbSecColumn_SRC.First(sec => sec.id == pDict["id_section"]); sectionInfo = GetColumnRcSection(columnSrc.StbSecFigureColumn_SRC.Item, columnSrc.strength_concrete).ToList(); foreach (object item in columnSrc.StbSecSteelFigureColumn_SRC.Items) { sectionInfo.AddRange(GetColumnSSection(item).ToList()); } break; case "S": StbSecSteelFigureColumn_S sFigure = sections.StbSecColumn_S.First(sec => sec.id == pDict["id_section"]).StbSecSteelFigureColumn_S; foreach (object item in sFigure.Items) { sectionInfo.AddRange(GetColumnSSection(item).ToList()); } break; } break; case "StbGirder": case "StbBeam": switch (pDict["kind_structure"]) { case "RC": StbSecBeam_RC beamRc = sections.StbSecBeam_RC.First(sec => sec.id == pDict["id_section"]); foreach (object item in beamRc.StbSecFigureBeam_RC.Items) { sectionInfo.AddRange(GetBeamRcSection(item, beamRc.strength_concrete)); } break; case "SRC": StbSecBeam_SRC beamSrc = sections.StbSecBeam_SRC.First(sec => sec.id == pDict["id_section"]); foreach (object item in beamSrc.StbSecFigureBeam_SRC.Items) { sectionInfo.AddRange(GetBeamRcSection(item, beamSrc.strength_concrete)); } foreach (object item in beamSrc.StbSecSteelFigureBeam_SRC.Items) { sectionInfo.AddRange(GetBeamSSection(item).ToList()); } break; case "S": StbSecSteelFigureBeam_S sFigure = sections.StbSecBeam_S.First(sec => sec.id == pDict["id_section"]).StbSecSteelFigureBeam_S; foreach (object item in sFigure.Items) { sectionInfo.AddRange(GetBeamSSection(item).ToList()); } break; } break; case "StbBrace": switch (pDict["kind_structure"]) { case "S": StbSecSteelFigureBrace_S sFigure = sections.StbSecBrace_S.First(sec => sec.id == pDict["id_section"]).StbSecSteelFigureBrace_S; foreach (object item in sFigure.Items) { sectionInfo.AddRange(GetBraceSSection(item).ToList()); } break; } break; case "StbSlab": switch (pDict["kind_structure"]) { case "RC": StbSecSlab_RC slabRc = sections.StbSecSlab_RC.First(sec => sec.id == pDict["id_section"]); foreach (object item in slabRc.StbSecFigureSlab_RC.Items) { sectionInfo.AddRange(GetSlabRcSection(item, slabRc.strength_concrete).ToList()); } break; case "DECK": StbSecSlabDeck slabDeck = sections.StbSecSlabDeck.First(sec => sec.id == pDict["id_section"]); var deckFigure = slabDeck.StbSecFigureSlabDeck.StbSecSlabDeckStraight; sectionInfo.AddRange(GetSlabDeckSection(deckFigure, slabDeck.strength_concrete).ToList()); break; case "PRECAST": StbSecSlabPrecast slabPrecast = sections.StbSecSlabPrecast.First(sec => sec.id == pDict["id_section"]); sectionInfo.AddRange(GetSlabPrecastSection(slabPrecast.precast_type, slabPrecast.StbSecProductSlabPrecast, slabPrecast.strength_concrete).ToList()); break; } break; case "StbWall": // RC しかない StbSecWall_RC wallRc = sections.StbSecWall_RC.First(sec => sec.id == pDict["id_section"]); sectionInfo = GetWallRcSection(wallRc.StbSecFigureWall_RC.StbSecWall_RC_Straight, wallRc.strength_concrete).ToList(); break; } foreach ((string str, int i) in sectionInfo.Select((str, i) => (str.ToString(), i))) { pDict.Add($"Figure{i}", str); } }
private static GH_Structure <GH_String> GetTagStrings(IEnumerable <StbBrace> braces, StbSections sections) { var ghSecStrings = new GH_Structure <GH_String>(); if (braces == null) { return(ghSecStrings); } foreach (var item in braces.Select((brace, index) => new { brace, index })) { string secId = item.brace.id_section; var ghPath = new GH_Path(0, item.index); StbBraceKind_structure kindStruct = item.brace.kind_structure; switch (kindStruct) { case StbBraceKind_structure.S: StbSecBrace_S secS = sections.StbSecBrace_S.First(i => i.id == secId); foreach (object figureObj in secS.StbSecSteelFigureBrace_S.Items) { ghSecStrings.AppendRange(TagUtils.GetBraceSSection(figureObj), ghPath); } break; case StbBraceKind_structure.RC: case StbBraceKind_structure.SRC: throw new ArgumentException("Unsupported section type."); default: throw new ArgumentOutOfRangeException(); } } return(ghSecStrings); }
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); }
public static double GetThickness(StbSections sections, StbWall wall) { return(sections.StbSecWall_RC.First(sec => sec.id == wall.id_section) .StbSecFigureWall_RC.StbSecWall_RC_Straight.t); }
private static GH_Structure <GH_String> GetTagStrings(IEnumerable <StbWall> walls, StbSections sections) { var ghSecStrings = new GH_Structure <GH_String>(); foreach (var item in walls.Select((wall, index) => new { wall, index })) { string secId = item.wall.id_section; var ghPath = new GH_Path(0, item.index); StbSecWall_RC secRc = sections.StbSecWall_RC.First(i => i.id == secId); StbSecWall_RC_Straight figure = secRc.StbSecFigureWall_RC.StbSecWall_RC_Straight; ghSecStrings.AppendRange(TagUtils.GetWallRcSection(figure, secRc.strength_concrete), ghPath); } return(ghSecStrings); }
public Girder(StbSections sections, IReadOnlyList <double> tolerance) { _tolerance = tolerance; _sections = sections; }
public CreateMemberBrepListFromStb(StbSections sections, IEnumerable <StbNode> nodes, IReadOnlyList <double> tolerance) { _nodes = nodes; _tolerance = tolerance; _sections = sections; }
private static Dictionary <string, string>[] StbMembersToDictArray(IReadOnlyList <object> members, StbSections sections) { var propertiesArray = new Dictionary <string, string> [members.Count]; object item = members[0]; Type t = item.GetType(); foreach ((object member, int index) in members.Select((column, index) => (column, index))) { propertiesArray[index] = GetMemberInfoDictionary(t, member, sections); } return(propertiesArray); }
private static GH_Structure <GH_String> GetTagStrings(IEnumerable <StbSlab> slabs, StbSections sections) { var ghSecStrings = new GH_Structure <GH_String>(); foreach (var item in slabs.Select((slab, index) => new { slab, index })) { SetSectionInfo(sections, ghSecStrings, item.slab, item.index); } return(ghSecStrings); }
private static void SetK3dCroSecElemId(StbSections sections, CroSec k3dCroSec, string steelShapeName) { CheckSecColumnIdMatching(sections.StbSecColumn_S, k3dCroSec, steelShapeName); CheckSecBeamIdMatching(sections.StbSecBeam_S, k3dCroSec, steelShapeName); CheckSecBraceIdMatching(sections.StbSecBrace_S, k3dCroSec, steelShapeName); }
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); }
protected override void SolveInstance(IGH_DataAccess dataAccess) { var path = string.Empty; var isOutput = false; var nodes = new List <StbNode>(); var axes = new StbAxes(); var stories = new List <StbStory>(); var members = new StbMembers(); var sections = new StbSections(); if (!dataAccess.GetDataList(0, nodes)) { return; } if (!dataAccess.GetData(1, ref axes)) { return; } if (!dataAccess.GetDataList(2, stories)) { return; } if (!dataAccess.GetData(3, ref members)) { return; } if (!dataAccess.GetData(4, ref sections)) { return; } if (!dataAccess.GetData(5, ref path)) { return; } if (!dataAccess.GetData(6, ref isOutput)) { return; } var stbData = new ST_BRIDGE { version = "2.0.2", StbCommon = new StbCommon { project_name = ActiveCanvasFileName(), app_name = "HoaryFox", }, StbModel = new StbModel { StbAxes = axes, StbStories = stories.ToArray(), StbNodes = nodes.ToArray(), StbMembers = members, StbSections = sections, StbJoints = new StbJoints(), }, StbAnaModels = Array.Empty <StbAnaModel>(), StbCalData = new StbCalData(), }; if (isOutput) { bool result = Serializer.Serialize(stbData, path, STBDotNet.Enums.Version.Stb202); if (!result) { throw new Exception("Failed to serialize."); } } dataAccess.SetData(0, stbData); }
public GirderFigureToCurveList(StbSections sections) { _sections = sections; }