private void Button_Click(object sender, RoutedEventArgs e) { ExportedResults exportedResults = DataExtraction.ExtractSAPInfo.PopulateDesignResults(); //AMIT WHERE CAN I STORE THE OBJECT ABOVE }
/// <summary> /// ALEKSANDRA COPY AND PASTE DATAEXTRACTION.TESTING CODE HERE /// </summary> /// <returns></returns> public static ExportedResults PopulateDesignResults() { //Attach to existing SAP2000v22 model cHelper myHelper = new Helper(); cOAPI mySapObject = myHelper.GetObject("CSI.SAP2000.API.SapObject"); cSapModel mySapModel = mySapObject.SapModel; //Get list of all frames int numbernames = 0; string[] names = null; mySapModel.FrameObj.GetNameList(ref numbernames, ref names); string outputname = ""; for (int i = 0; i < numbernames; i++) { bool notselected = false; mySapModel.FrameObj.GetSelected(names[i], ref notselected); if (notselected) { outputname = names[i]; break; } } string point1 = ""; string point2 = ""; mySapModel.FrameObj.GetPoints(outputname, ref point1, ref point2); double x1 = 0; double y1 = 0; double z1 = 0; double x2 = 0; double y2 = 0; double z2 = 0; mySapModel.PointObj.GetCoordCartesian(point1, ref x1, ref y1, ref z1); mySapModel.PointObj.GetCoordCartesian(point2, ref x2, ref y2, ref z2); string pointname = point1; if (z2 < z1) { pointname = point2; } int numres = 0; string[] obj = null; string[] elm = null; string[] loadcase = null; string[] steptype = null; double[] stepnum = null; double[] f1 = null; double[] f2 = null; double[] f3 = null; double[] m1 = null; double[] m2 = null; double[] m3 = null; mySapModel.Results.JointReact(pointname, eItemTypeElm.ObjectElm, ref numres, ref obj, ref elm, ref loadcase, ref steptype, ref stepnum, ref f1, ref f2, ref f3, ref m1, ref m2, ref m3); List <ForceObject> exportforce = new List <ForceObject>(); for (int j = 0; j < numres; j++) { ForceObject fobj = new ForceObject(f1[j], f2[j], f3[j], m1[j], m2[j], m3[j]); exportforce.Add(fobj); } string propname = ""; string sauto = ""; mySapModel.FrameObj.GetSection(outputname, ref propname, ref sauto); double fy = 0; double fu = 0; double efy = 0; double efu = 0; int sstype = 0; int sshys = 0; double strainhard = 0; double strainmax = 0; double strainrupt = 0; string matprop = ""; mySapModel.PropFrame.GetMaterial(propname, ref matprop); mySapModel.PropMaterial.GetOSteel(matprop, ref fy, ref fu, ref efy, ref efu, ref sstype, ref sshys, ref strainhard, ref strainmax, ref strainrupt); Steel steel = new Steel(matprop, fy); Column col = new Column(propname, steel); ExportedResults expres = new ExportedResults(); expres._column = col; expres._name = outputname; expres._exportedforces = exportforce; return(expres); }
public static DesignResults DesignGravity(BPDesign bpdesign) { ISection col = bpdesign._column; Foundation fndn = bpdesign._fndn; Baseplate bp = bpdesign._bp; ExportedResults exres = bpdesign._exres; //AnchorRod anchors = bpdesign._anchors; DesignResults desresult = new DesignResults(); //gravity baseplate design here double Pu; double fprimec; double bpArea; double fndnArea; double sqrtA2A1; double Pp; double phiPn; double m; double n; double d = col._d; double bf = col._bf; double X; double lambda; double lambdaNprime; double l; double tMin; double fy = bp._steel._Fy; double B = bp._width; double N = bp._height; //Axial checks Pu = Math.Abs(exres._exportedforces._Fz); fprimec = fndn._concrete._fprimec; bpArea = B * N; fndnArea = fndn._width * fndn._height; sqrtA2A1 = Math.Min(Math.Sqrt(fndnArea / bpArea), 2); Pp = Math.Min(0.85 * fprimec * bpArea * sqrtA2A1, 1.7 * fprimec * bpArea); phiPn = Math.Round(PHI_C * Pp, 2); desresult.BearingCapacity = phiPn; desresult.BearingDCR = Math.Round(Pu / phiPn, 2); //Min baseplate thickness m = (bp._height - 0.95 * d) / 2; n = (bp._width - 0.8 * bf) / 2; X = ((4 * d * bf) / Math.Pow((d + bf), 2)) * desresult.BearingDCR; lambda = Math.Min((2 * Math.Sqrt(X)) / (1 + (Math.Sqrt(1 - X))), 1); lambdaNprime = lambda * (Math.Sqrt(d * bf) / 4); l = Math.Max(m, Math.Max(n, lambdaNprime)); tMin = Math.Round(l * Math.Sqrt((2 * Pu) / (PHI_B * fy * B * N)), 2); desresult.MinReqdThickness = tMin; // Anchor Rod Checks desresult.AnchorRodTension = 10; return(desresult); }