public void SetLCS(AttachedMember attachedMember, LineSegment3D lineSegment) { //Defining LCS for First lineSegment double xcor = attachedMember.ElementRAZ.line.vector.X; double ycor = attachedMember.ElementRAZ.line.vector.Y; double zcor = attachedMember.ElementRAZ.line.vector.Z; //Define LCS (local-y in XY plane) and unitize VectorRAZ vx = new VectorRAZ(xcor, ycor, zcor).Unitize(); VectorRAZ vy = new VectorRAZ(); VectorRAZ vz = new VectorRAZ(); if (xcor == 0.0 && ycor == 0.0) { vy = new VectorRAZ(0.0, 1.0, 0.0).Unitize(); vz = new VectorRAZ((-zcor), 0.0, (xcor)).Unitize(); } else { vy = new VectorRAZ(-ycor, xcor, 0.0).Unitize(); vz = new VectorRAZ((-zcor * xcor), (-zcor * ycor), ((xcor * xcor) + (ycor * ycor))).Unitize(); } if (attachedMember.ElementRAZ.rotationLCS == 0.0) { } else { vy = VectorRAZ.RotateVector(vx, attachedMember.ElementRAZ.rotationLCS, vy); vz = VectorRAZ.RotateVector(vx, attachedMember.ElementRAZ.rotationLCS, vz); } var LocalCoordinateSystem = new CoordSystemByVector(); LocalCoordinateSystem.VecX = new Vector3D() { X = vx.X, Y = vx.Y, Z = vx.Z }; LocalCoordinateSystem.VecY = new Vector3D() { X = vy.X, Y = vy.Y, Z = vy.Z }; LocalCoordinateSystem.VecZ = new Vector3D() { X = vz.X, Y = vz.Y, Z = vz.Z }; lineSegment.LocalCoordinateSystem = LocalCoordinateSystem; }
public void SetLCSwithRotation(AttachedMember attachedMember, LineSegment3D lineSegment) { //Explode x-vector double xcor = attachedMember.ElementRAZ.line.vector.X; double ycor = attachedMember.ElementRAZ.line.vector.Y; double zcor = attachedMember.ElementRAZ.line.vector.Z; VectorRAZ vx = new VectorRAZ(xcor, ycor, zcor).Unitize(); double rotation = attachedMember.ElementRAZ.rotationLCS; //Explode z-vector double xcorZ = 0.0; double ycorZ = 0.0; double zcorZ = 0.0; VectorRAZ vz = new VectorRAZ(xcorZ, ycorZ, zcorZ).Unitize(); //Create y-vector with cross-product VectorRAZ vy = new VectorRAZ(); vz = new VectorRAZ((vz.Y * vx.Z - vx.Y * vz.Z), (-vz.X * vx.Z + vx.X * vz.Z), (vz.X * vx.Y - vx.X * vz.Y)).Unitize(); //Set LCS var LocalCoordinateSystem = new CoordSystemByVector(); LocalCoordinateSystem.VecX = new Vector3D() { X = vx.X, Y = vx.Y, Z = vx.Z }; LocalCoordinateSystem.VecY = new Vector3D() { X = vy.X, Y = vy.Y, Z = vy.Z }; LocalCoordinateSystem.VecZ = new Vector3D() { X = vz.X, Y = vz.Y, Z = vz.Z }; lineSegment.LocalCoordinateSystem = LocalCoordinateSystem; }
private void CreateIDEAOpenModelResultsOLD(Joint joint) { Project project = joint.project; openModelResult.ResultOnMembers = new List <ResultOnMembers>(); ResultOnMembers resultIF = new ResultOnMembers(); for (int ibeam = 0; ibeam < openModel.Member1D.Count; ibeam++) { //Continues Chord consist out of one member Member1D mb = openModel.Member1D[ibeam]; for (int iele = 0; iele < mb.Elements1D.Count; iele++) { //Continues chord consist out of two elements Element1D elem = openModel.Element1D.First(a => a.Id == mb.Elements1D[iele].Id); //results on members are constant in the framework ResultOnMember resMember = new ResultOnMember(new Member() { Id = elem.Id, MemberType = MemberType.Element1D }, ResultType.InternalForces); int numPoints = 10; for (int ip = 0; ip <= numPoints; ip++) { ResultOnSection resSec = new ResultOnSection(); resSec.AbsoluteRelative = AbsoluteRelative.Relative; resSec.Position = (double)ip / (double)numPoints; //iterate over loadcases int count = openModel.LoadCase.Count; for (int i = 1; i <= count; i++) { ResultOfInternalForces resLoadCase = new ResultOfInternalForces(); int loadCaseNumber = i; resLoadCase.Loading = new ResultOfLoading() { Id = loadCaseNumber, LoadingType = LoadingType.LoadCase }; resLoadCase.Loading.Items.Add(new ResultOfLoadingItem() { Coefficient = 1.0 }); //Check if Startpoint is equal to centerpoint int GrassId = elem.Id - 1;//Element1D.Id - 1 == ElementRAZ.id int GrassLCId = i - 1; AttachedMember attached = joint.attachedMembers.Find(a => a.ElementRAZ.id == GrassId); //The following if statements simulate that every member has a local coordinate system //where the local z - axis points counterclockwise(shear force) //and where the positive bending moment is clockwise if (attached.isStartPoint == true) { //Pick startloads // API to IDEA UI, My and Vz are plotted negatively double N0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.N; double My0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.My * -1; double Vz0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.Vz * -1; double Vy0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.Vy; double Mz0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.Mz; double Mt0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.Mt; //From Karamba3D to Framework double N = N0; double My = My0; double Vz = Vz0; double Vy = Vy0; double Mz = Mz0; double Mt = Mt0; //From Framework to IDEA VectorRAZ unitvector = attached.ideaLine.vector.Unitize();//gaat niet op bij ColumnT-Joint want gebruikt globale asses ipv locale if (unitvector.X < -10e-6) { if (attached is BearingMember) //exception { resLoadCase.N = N; // resLoadCase.My = My * (-1); // in case of start point M of the begin element of the chords needs to be flipped resLoadCase.Qz = Vz * (-1); // resLoadCase.Qy = Vy; resLoadCase.Mz = Mz0; resLoadCase.Mx = Mt; resSec.Results.Add(resLoadCase); } else//members where rule needs to be applied to { resLoadCase.N = N;// resLoadCase.My = My * -1; // resLoadCase.Qz = Vz * -1; // resLoadCase.Qy = Vy; resLoadCase.Mz = Mz0; resLoadCase.Mx = Mt; resSec.Results.Add(resLoadCase); } } else { resLoadCase.N = N; // resLoadCase.My = My; // resLoadCase.Qz = Vz; // resLoadCase.Qy = Vy; resLoadCase.Mz = Mz0; resLoadCase.Mx = Mt; resSec.Results.Add(resLoadCase); } } else//isEndPoint { //Pick endloads //API to IDEA UI, My and Vz are plotted negatively double N0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.N; double My0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.My * -1; double Vz0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Vz * -1; double Vy0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Vy; double Mz0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Mz; double Mt0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Mt; //From Karamba3D to Framework double N = N0; double My = My0 * (-1); //*-1 double Vz = Vz0 * (-1); //*-1 double Vy = Vy0 * (-1); //*-1 double Mz = Mz0 * (-1); //*-1 double Mt = Mt0 * (-1); //*-1 //From Framework to IDEA VectorRAZ unitvector = attached.ideaLine.vector.Unitize();//gaat niet op bij ColumnT-Joint want gebruikt globale asses ipv locale if (unitvector.X < -10e-6) { if (attached is BearingMember) //exception { resLoadCase.N = N; // resLoadCase.My = My * (-1); // in case of start point M of the begin element of the chords needs to be flipped resLoadCase.Qz = Vz * (-1); // resLoadCase.Qy = Vy * (-1); resLoadCase.Mz = Mz0 * (-1); resLoadCase.Mx = Mt * (-1); resSec.Results.Add(resLoadCase); } else//members where rule needs to be applied to { resLoadCase.N = N;// resLoadCase.My = My * (-1); // * (-1) resLoadCase.Qz = Vz * (-1); // * (-1) resLoadCase.Qy = Vy * (-1); resLoadCase.Mz = Mz0 * (-1); resLoadCase.Mx = Mt * (-1); resSec.Results.Add(resLoadCase); } } else { resLoadCase.N = N; // resLoadCase.My = My; // resLoadCase.Qz = Vz; // resLoadCase.Qy = Vy; resLoadCase.Mz = Mz0; resLoadCase.Mx = Mt; resSec.Results.Add(resLoadCase); } } } resMember.Results.Add(resSec); } resultIF.Members.Add(resMember); } } openModelResult.ResultOnMembers.Add(resultIF); }
private void CreateIDEAOpenModelResults(Joint joint) { Project project = joint.project; openModelResult.ResultOnMembers = new List <ResultOnMembers>(); ResultOnMembers resultIF = new ResultOnMembers(); for (int ibeam = 0; ibeam < openModel.Member1D.Count; ibeam++) { //Continues Chord consist out of one member Member1D mb = openModel.Member1D[ibeam]; //Loop is needed in case of a continuous member for (int iele = 0; iele < mb.Elements1D.Count; iele++) { //Continues chord consists out of two elements Element1D elem = openModel.Element1D.First(a => a.Id == mb.Elements1D[iele].Id);//wordt hier de link met het verkeerde element gelegd? //word de verkeerde id toegekent? //results on members are constant in the framework ResultOnMember resMember = new ResultOnMember(new Member() { Id = elem.Id, MemberType = MemberType.Element1D }, ResultType.InternalForces); int numPoints = 10; for (int ip = 0; ip <= numPoints; ip++) { ResultOnSection resSec = new ResultOnSection(); resSec.AbsoluteRelative = AbsoluteRelative.Relative; resSec.Position = (double)ip / (double)numPoints; //iterate over loadcases int count = openModel.LoadCase.Count; for (int i = 1; i <= count; i++) { ResultOfInternalForces resLoadCase = new ResultOfInternalForces(); int loadCaseNumber = i; resLoadCase.Loading = new ResultOfLoading() { Id = loadCaseNumber, LoadingType = LoadingType.LoadCase }; resLoadCase.Loading.Items.Add(new ResultOfLoadingItem() { Coefficient = 1.0 }); //Check if Startpoint is equal to centerpoint int GrassId = elem.Id - 1;//Element1D.Id - 1 == ElementRAZ.id int GrassLCId = i - 1; AttachedMember attached = joint.attachedMembers.Find(a => a.ElementRAZ.id == GrassId); //The following if statements simulate that every member has a local coordinate system //where the local z-axis points counterclockwise (shear force) //and where the positive bending moment is clockwise if (attached.isStartPoint == true) { //Pick startloads //API to IDEA UI, My, Vy and Vz are plotted negatively double N0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.N; double My0 = (-1) * 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.My; double Vz0 = (-1) * 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.Vz; double Vy0 = (-1) * 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.Vy; double Mz0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.Mz; double Mt0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].startLoads.Mt; //From Karamba3D to Framework double N = N0; double My = My0; double Vz = Vz0; double Vy = Vy0; double Mz = Mz0; double Mt = Mt0; resLoadCase.N = N; // resLoadCase.My = My; // resLoadCase.Qz = Vz; // resLoadCase.Qy = Vy; resLoadCase.Mz = Mz; resLoadCase.Mx = Mt; resSec.Results.Add(resLoadCase); } else//isEndPoint { //Pick endloads //API to IDEA UI, My, Vy and Vz are plotted negatively double N0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.N; double My0 = (-1) * 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.My; double Vz0 = (-1) * 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Vz; double Vy0 = (-1) * 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Vy; double Mz0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Mz; double Mt0 = 1000 * joint.project.loadcases[GrassLCId].loadsPerLineRAZs[GrassId].endLoads.Mt; //From Karamba3D to Framework double N = N0 * (-1); double My = My0 * (-1); // double Vz = Vz0 * (-1); double Vy = Vy0 * (-1); double Mz = Mz0 * (-1); // double Mt = Mt0 * (-1); resLoadCase.N = N; // resLoadCase.My = My; // resLoadCase.Qz = Vz; // resLoadCase.Qy = Vy; resLoadCase.Mz = Mz; resLoadCase.Mx = Mt; resSec.Results.Add(resLoadCase); } } resMember.Results.Add(resSec); } resultIF.Members.Add(resMember); } } openModelResult.ResultOnMembers.Add(resultIF); }
private void AddConnectedMember(AttachedMember attachedMember, ConnectionPoint connectionPoint) { PolyLine3D polyLine3D = new PolyLine3D(); polyLine3D.Id = openModel.GetMaxId(polyLine3D) + 1; openModel.AddObject(polyLine3D); //endpoints Point3D pA = openModel.Point3D.First(a => a.Id == attachedMember.ideaLine.Start.id); Point3D pB = openModel.Point3D.First(a => a.Id == attachedMember.ideaLine.End.id); //create line segment LineSegment3D lineSegment = new LineSegment3D(); lineSegment.Id = openModel.GetMaxId(lineSegment) + 1; lineSegment.StartPoint = new ReferenceElement(pA); lineSegment.EndPoint = new ReferenceElement(pB); openModel.AddObject(lineSegment); polyLine3D.Segments.Add(new ReferenceElement(lineSegment)); ///* double xcor = attachedMember.ElementRAZ.line.vector.X; double ycor = attachedMember.ElementRAZ.line.vector.Y; double zcor = attachedMember.ElementRAZ.line.vector.Z; //Define LCS (local-y in XY plane) and unitize VectorRAZ vx = new VectorRAZ(xcor, ycor, zcor).Unitize(); VectorRAZ vy = new VectorRAZ(); VectorRAZ vz = new VectorRAZ(); if (xcor == 0.0 && ycor == 0.0) { vy = new VectorRAZ(0.0, 1.0, 0.0).Unitize(); vz = new VectorRAZ((-zcor), 0.0, (xcor)).Unitize(); } else { vy = new VectorRAZ(-ycor, xcor, 0.0).Unitize(); vz = new VectorRAZ((-zcor * xcor), (-zcor * ycor), ((xcor * xcor) + (ycor * ycor))).Unitize(); } var LocalCoordinateSystem = new CoordSystemByVector(); LocalCoordinateSystem.VecX = new Vector3D() { X = vx.X, Y = vx.Y, Z = vx.Z }; LocalCoordinateSystem.VecY = new Vector3D() { X = vy.X, Y = vy.Y, Z = vy.Z }; LocalCoordinateSystem.VecZ = new Vector3D() { X = vz.X, Y = vz.Y, Z = vz.Z }; lineSegment.LocalCoordinateSystem = LocalCoordinateSystem; //*/ //create element Element1D element1D = new Element1D(); //element1D.Id = openModel.GetMaxId(element1D) + 1; element1D.Id = attachedMember.ElementRAZ.id + 1; //Use of Id from Grasshopper Model + Plus One element1D.Name = "Element " + element1D.Id.ToString(); element1D.Segment = new ReferenceElement(lineSegment); IdeaRS.OpenModel.CrossSection.CrossSection crossSection = openModel.CrossSection.First(a => a.Id == attachedMember.ElementRAZ.crossSection.id); element1D.CrossSectionBegin = new ReferenceElement(crossSection); element1D.CrossSectionEnd = new ReferenceElement(crossSection); if (attachedMember is ConnectingMember) { ConnectingMember connectingMember = attachedMember as ConnectingMember; double eccentricty = new double(); if (connectingMember.localEccentricity == -0) { eccentricty = 0; } else { eccentricty = connectingMember.localEccentricity; } element1D.EccentricityBeginZ = eccentricty; element1D.EccentricityEndZ = eccentricty; } openModel.AddObject(element1D); //create member Member1D member1D = new Member1D(); member1D.Id = openModel.GetMaxId(member1D) + 1; member1D.Name = "Member " + member1D.Id.ToString(); member1D.Elements1D.Add(new ReferenceElement(element1D)); openModel.Member1D.Add(member1D); //create connected member ConnectedMember connectedMember = new ConnectedMember(); connectedMember.Id = member1D.Id; connectedMember.MemberId = new ReferenceElement(member1D); connectionPoint.ConnectedMembers.Add(connectedMember); }
private void CreateIDEAOpenModelResults(Joint joint) { Project project = joint.project; openModelResult.ResultOnMembers = new List <ResultOnMembers>(); ResultOnMembers resultIF = new ResultOnMembers(); for (int ibeam = 0; ibeam < openModel.Member1D.Count; ibeam++) { //Continues Chord consist out of one member Member1D mb = openModel.Member1D[ibeam]; //Loop is needed in case of a continuous member for (int iele = 0; iele < mb.Elements1D.Count; iele++) { //Continouos chord consists out of two elements Element1D elem = openModel.Element1D.First(a => a.Id == mb.Elements1D[iele].Id);//wordt hier de link met het verkeerde element gelegd? //word de verkeerde id toegekent? //results on members are constant in the framework ResultOnMember resMember = new ResultOnMember(new Member() { Id = elem.Id, MemberType = MemberType.Element1D }, ResultType.InternalForces); int numPoints = 1; for (int ip = 0; ip <= numPoints; ip++) { ResultOnSection resSec = new ResultOnSection(); resSec.AbsoluteRelative = AbsoluteRelative.Relative; resSec.Position = (double)ip / (double)numPoints; //iterate over loadcases int count = openModel.LoadCase.Count; for (int i = 1; i <= count; i++) { ResultOfInternalForces resLoadCase = new ResultOfInternalForces(); int loadCaseNumber = i; resLoadCase.Loading = new ResultOfLoading() { Id = loadCaseNumber, LoadingType = LoadingType.LoadCase }; resLoadCase.Loading.Items.Add(new ResultOfLoadingItem() { Coefficient = 1.0 }); //Check if Startpoint is equal to centerpoint int GrassId = elem.Id - 1; //Element1D.Id - 1 == ElementRAZ.id int GrassLCId = i - 1; //Loadcase grasshopper starts at 0, Loadcase IDEA starts at 1. List <BearingMember> BM = joint.attachedMembers.OfType <BearingMember>().ToList(); //Find the element to check: isStartpoint true or false AttachedMember attached = joint.attachedMembers.Find(a => a.ElementRAZ.id == GrassId); if (attached.isStartPoint == true) // { SetStartLoads(1, joint, GrassLCId, GrassId, resLoadCase, resSec); } else//isEndPoint { if (attached is BearingMember && BM.Count == 2) { SetEndLoads(1, joint, GrassLCId, GrassId, resLoadCase, resSec); } else { SetEndLoads(-1, joint, GrassLCId, GrassId, resLoadCase, resSec); } } } resMember.Results.Add(resSec); } resultIF.Members.Add(resMember); } } openModelResult.ResultOnMembers.Add(resultIF); }
private void AddConnectedMember(AttachedMember attachedMember, ConnectionPoint connectionPoint) { PolyLine3D polyLine3D = new PolyLine3D(); polyLine3D.Id = openModel.GetMaxId(polyLine3D) + 1; openModel.AddObject(polyLine3D); //endpoints Point3D pA = openModel.Point3D.First(a => a.Id == attachedMember.ideaLine.Start.id); Point3D pB = openModel.Point3D.First(a => a.Id == attachedMember.ideaLine.End.id); //create line segment LineSegment3D lineSegment = new LineSegment3D(); lineSegment.Id = openModel.GetMaxId(lineSegment) + 1; lineSegment.StartPoint = new ReferenceElement(pA); lineSegment.EndPoint = new ReferenceElement(pB); openModel.AddObject(lineSegment); polyLine3D.Segments.Add(new ReferenceElement(lineSegment)); SetLCS(attachedMember, lineSegment); //create element Element1D element1D = new Element1D(); //element1D.Id = openModel.GetMaxId(element1D) + 1; element1D.Id = attachedMember.ElementRAZ.id + 1; //Use of Id from Grasshopper Model + Plus One element1D.Name = "Element " + element1D.Id.ToString(); element1D.Segment = new ReferenceElement(lineSegment); IdeaRS.OpenModel.CrossSection.CrossSection crossSection = openModel.CrossSection.First(a => a.Id == attachedMember.ElementRAZ.crossSection.id); element1D.CrossSectionBegin = new ReferenceElement(crossSection); element1D.CrossSectionEnd = new ReferenceElement(crossSection); //element1D.RotationRx = attachedMember.ElementRAZ.rotationLCS; if (attachedMember is ConnectingMember) { ConnectingMember connectingMember = attachedMember as ConnectingMember; double eccentricty = new double(); if (connectingMember.localEccentricity == -0) { eccentricty = 0; } else { eccentricty = connectingMember.localEccentricity; } element1D.EccentricityBeginZ = eccentricty; element1D.EccentricityEndZ = eccentricty; } openModel.AddObject(element1D); //create member Member1D member1D = new Member1D(); member1D.Id = openModel.GetMaxId(member1D) + 1; member1D.Name = "Member " + member1D.Id.ToString(); member1D.Elements1D.Add(new ReferenceElement(element1D)); openModel.Member1D.Add(member1D); //create connected member ConnectedMember connectedMember = new ConnectedMember(); connectedMember.Id = member1D.Id; connectedMember.MemberId = new ReferenceElement(member1D); connectionPoint.ConnectedMembers.Add(connectedMember); }