private void Initialize(Geometry.FdPoint3d start, Geometry.FdPoint3d end, Guid baseObject, PtcShapeType shape, PtcLosses losses, PtcManufacturingType manufacturing, PtcStrandLibType strand, JackingSide jackingSide, double jackingStress, int numberOfStrands, string identifier) { StartPoint = start; EndPoint = end; BaseObject = baseObject; StrandType = strand; StrandTypeGuid = strand.Guid; Name = $"{identifier}.{++instances}"; Losses = losses; NumberOfStrands = numberOfStrands; JackingSide = jackingSide; JackingStress = jackingStress; ShapeBasePoints = shape; Manufacturing = manufacturing; EntityCreated(); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { string name = null; double f_pk = 0.0; double a_p = 0.0; double e_p = 0.0; double density = 0.0; int relaxationClass = 2; double rho_1000 = 0.0; DA.GetData("Name", ref name); DA.GetData("f pk", ref f_pk); DA.GetData("A p", ref a_p); DA.GetData("E p", ref e_p); DA.GetData("Rho", ref density); DA.GetData("RelaxationClass", ref relaxationClass); DA.GetData("Rho 1000", ref rho_1000); var strand = new PtcStrandLibType(name, f_pk, a_p, e_p, density, relaxationClass, rho_1000); DA.SetData("PtcStrand", strand); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { Bars.Bar bar = null; PtcShapeType shape = null; PtcLosses losses = null; PtcManufacturingType manufacturing = null; PtcStrandLibType strandData = null; string jackingSide = "start"; double jackingStress = 200.0; int numberOfStrands = 3; string identifier = "PTC"; DA.GetData("Bar", ref bar); DA.GetData("Shape", ref shape); DA.GetData("Losses", ref losses); DA.GetData("Manufacturing", ref manufacturing); DA.GetData("StrandData", ref strandData); DA.GetData("JackingSide", ref jackingSide); DA.GetData("JackingStress", ref jackingStress); DA.GetData("NumberOfStrands", ref numberOfStrands); DA.GetData("Identifier", ref identifier); if (bar == null || shape == null || losses == null || manufacturing == null || strandData == null) { return; } JackingSide side = GenericClasses.EnumParser.Parse <JackingSide>(jackingSide); var ptc = new Ptc(bar, shape, losses, manufacturing, strandData, side, jackingStress, numberOfStrands, identifier); // add to bar var clone = bar.DeepClone(); clone.Ptc.Add(ptc); DA.SetData("Bar", clone); }
/// <summary> /// Construct post-tension cable /// </summary> /// <param name="slab">Reference slab element</param> /// <param name="line">Cable line</param> /// <param name="shape"></param> /// <param name="losses"></param> /// <param name="manufacturing"></param> /// <param name="strand"></param> /// <param name="numberOfStrands"></param> /// <param name="identifier"></param> public Ptc(Shells.Slab slab, Geometry.LineSegment line, PtcShapeType shape, PtcLosses losses, PtcManufacturingType manufacturing, PtcStrandLibType strand, JackingSide jackingSide, double jackingStress, int numberOfStrands = 3, string identifier = "PTC") { Initialize(line.StartPoint, line.EndPoint, slab.SlabPart.Guid, shape, losses, manufacturing, strand, jackingSide, jackingStress, numberOfStrands, identifier); }
/// <summary> /// Construct post-tension cable /// </summary> /// <param name="bar">Reference bar element</param> /// <param name="shape"></param> /// <param name="losses"></param> /// <param name="manufacturing"></param> /// <param name="strand"></param> /// <param name="numberOfStrands"></param> /// <param name="identifier"></param> public Ptc(Bars.Bar bar, PtcShapeType shape, PtcLosses losses, PtcManufacturingType manufacturing, PtcStrandLibType strand, JackingSide jackingSide, double jackingStress, int numberOfStrands = 3, string identifier = "PTC") { if (bar.BarPart.Edge.Type == "line") { var start = bar.BarPart.Edge.Points[0]; var end = bar.BarPart.Edge.Points[1]; Initialize(start, end, bar.BarPart.Guid, shape, losses, manufacturing, strand, jackingSide, jackingStress, numberOfStrands, identifier); } else { throw new ArgumentException($"Bar must be of type line but got '{bar.BarPart.Edge.Type}'", "bar"); } }