private void btn_jload_add_Click(object sender, EventArgs e) { double Area_Factor = MyStrings.StringToDouble(txt_area_factor.Text, 0.6); double Velocity = MyStrings.StringToDouble(txt_velocity.Text, 0.6); double Pressure = MyStrings.StringToDouble(txt_pressure.Text, 0.6); double Width = 0.0; double Height = 0.0; string kStr = "SC "; Seismic_Calculations ss = new Seismic_Calculations(iACad); ss.Set_AS(); List <int> ll = ss.Get_FX_Joints(false); if (rbtn_fx_negative.Checked) { //ll = ss.Get_FX_Joints(false); Width = ss.list_z[0] - ss.list_z[ss.list_z.Count - 1]; Height = ss.list_y[1] - ss.list_y[ss.list_y.Count - 1]; } else if (rbtn_fx_positive.Checked) { ll = ss.Get_FX_Joints(true); Width = ss.list_z[0] - ss.list_z[ss.list_z.Count - 1]; Height = ss.list_y[1] - ss.list_y[ss.list_y.Count - 1]; } else if (rbtn_fz_positive.Checked) { ll = ss.Get_FZ_Joints(false); Width = ss.list_x[0] - ss.list_x[ss.list_x.Count - 1]; Height = ss.list_y[1] - ss.list_y[ss.list_y.Count - 1]; } else if (rbtn_fz_negative.Checked) { ll = ss.Get_FZ_Joints(true); Width = ss.list_x[0] - ss.list_x[ss.list_x.Count - 1]; Height = ss.list_y[1] - ss.list_y[ss.list_y.Count - 1]; } Width = Math.Abs(Width); Height = Math.Abs(Height); //Wind Rectangle Width = 13.432 m //Wind Rectangle Height = 26.810 m //Effective Area Factor = 0.60 (User Input) //Wind Rectangle Effective Area = 13.432 x 26.810 x 0.60 =216.067 Sq.m //Total Wind Force = 216.067 x 540 N. = 116676 N = 116.676 kN //Total Wind Force is to be applied on 30 Nodes as shown //Wind Force per Node = 116.676 / 30 = 3.89 kN in FX or FZ directions. double Wind_Eff_Area = Width * Height * Area_Factor; double total_force = Wind_Eff_Area * Pressure / 1000; double wind_force_per_node = total_force / ll.Count; //ll = ss.Get_FX_Joints(true); //ll = ss.Get_FZ_Joints(false); //ll = ss.Get_FZ_Joints(true); //for (int i = 1; i < ss.list_y.Count; i++) //{ //var jntLst = ss.Get_Floor_Joints(ss.list_y[i]); foreach (var item in ll) { if (rbtn_fz_positive.Checked) { kStr = item + " FZ " + (wind_force_per_node).ToString("f3"); } else if (rbtn_fz_negative.Checked) { kStr = item + " FZ -" + (wind_force_per_node).ToString("f3"); } else if (rbtn_fx_positive.Checked) { kStr = item + " FX " + (wind_force_per_node).ToString("f3"); } else if (rbtn_fx_negative.Checked) { kStr = item + " FX -" + (wind_force_per_node).ToString("f3"); } ASTRA_Data.Add(kStr); } //} //if (rbtn_fz_positive.Checked) //{ // kStr = kStr + " FZ "; //} ASTRA_Data.Add(kStr); if (Node != null) { if (btn_add.Text == "Change") { //Node = Node.Parent; //Node.Parent.Nodes.Clear(); Node.Text = "JOINT LOAD"; //var nd = Node.Nodes.Add("JOINT LOAD"); foreach (var item in ASTRA_Data) { Node.Nodes.Add(item); } //nd.Nodes.Add( this.Close(); } else { //Node.Text = "JOINT LOAD"; var nd = Node.Nodes.Add("JOINT LOAD"); foreach (var item in ASTRA_Data) { nd.Nodes.Add(item); } //Node.Nodes.Add(kStr); //Node.Expand(); Node.ExpandAll(); } } //else //{ this.Close(); }
private void btn_jload_add_Click(object sender, EventArgs e) { string kStr = "SC "; double dval = 0.0; dval = MyStrings.StringToDouble(txt_sc.Text, 0.0); if (dval != 0.0) { kStr = kStr + dval.ToString("f3"); } if (rbtn_fx_positive.Checked) { kStr = kStr + " FX "; } if (false) { #region CC List <double> list_x = new List <double>(); List <double> list_y = new List <double>(); List <double> list_z = new List <double>(); int i = 0; foreach (var item in iACad.AstraDocument.Joints) { if (!list_x.Contains(item.X)) { list_x.Add(item.X); } if (!list_y.Contains(item.Y)) { list_y.Add(item.Y); } if (!list_z.Contains(item.Z)) { list_z.Add(item.Z); } } list_x.Sort(); list_y.Sort(); list_z.Sort(); i = 0; System.Collections.Hashtable hash_XY = new System.Collections.Hashtable(); System.Collections.Hashtable hash_XZ = new System.Collections.Hashtable(); System.Collections.Hashtable hash_YX = new System.Collections.Hashtable(); System.Collections.Hashtable hash_YZ = new System.Collections.Hashtable(); System.Collections.Hashtable hash_ZX = new System.Collections.Hashtable(); System.Collections.Hashtable hash_ZY = new System.Collections.Hashtable(); //List<double> coords1 = new List<double>(); //List<double> coords2 = new List<double>(); JointCoordinateCollection coords1 = new JointCoordinateCollection(); JointCoordinateCollection coords2 = new JointCoordinateCollection(); foreach (var x in list_x) { coords1 = new JointCoordinateCollection(); coords2 = new JointCoordinateCollection(); foreach (var item in iACad.AstraDocument.Joints) { if (item.X == x) { if (!coords1.Contains(item)) { coords1.Add(item); } if (!coords2.Contains(item)) { coords2.Add(item); } } } hash_XY.Add(x, coords1); hash_XZ.Add(x, coords2); } foreach (var y in list_y) { coords1 = new JointCoordinateCollection(); coords2 = new JointCoordinateCollection(); foreach (var item in iACad.AstraDocument.Joints) { if (item.Y == y) { if (!coords1.Contains(item)) { coords1.Add(item); } if (!coords2.Contains(item)) { coords2.Add(item); } } } hash_YX.Add(y, coords1); hash_YZ.Add(y, coords2); } hash_ZX = new System.Collections.Hashtable(); hash_ZY = new System.Collections.Hashtable(); foreach (var z in list_z) { coords1 = new JointCoordinateCollection(); coords2 = new JointCoordinateCollection(); foreach (var item in iACad.AstraDocument.Joints) { if (item.Z == z) { if (!coords1.Contains(item)) { coords1.Add(item); } if (!coords2.Contains(item)) { coords2.Add(item); } } } hash_ZX.Add(z, coords1); hash_ZY.Add(z, coords2); } #endregion CC } Seismic_Calculations ss = new Seismic_Calculations(iACad); ss.Set_AS(); List <double> forces = ss.Get_All_Forces(); List <double> latforces = ss.Get_Latetal_Forces(); double W = 0.0; foreach (var item in forces) { W += item; } double Fs = 0.0; foreach (var item in latforces) { Fs += item; } double Vb = W * dval; List <double> lst_Q = new List <double>(); foreach (var item in latforces) { lst_Q.Add(item * Vb / Fs); } //List<int> ll = ss.Get_FX_Joints(false); //ll = ss.Get_FX_Joints(true); //ll = ss.Get_FZ_Joints(false); //ll = ss.Get_FZ_Joints(true); for (int i = 1; i < ss.list_y.Count; i++) { var jntLst = ss.Get_Floor_Joints(ss.list_y[i]); foreach (var item in jntLst) { if (rbtn_fz_positive.Checked) { kStr = item + " FZ " + (lst_Q[i - 1] / jntLst.Count).ToString("f3"); } else if (rbtn_fz_negative.Checked) { kStr = item + " FZ -" + (lst_Q[i - 1] / jntLst.Count).ToString("f3"); } else if (rbtn_fx_positive.Checked) { kStr = item + " FX " + (lst_Q[i - 1] / jntLst.Count).ToString("f3"); } else if (rbtn_fx_negative.Checked) { kStr = item + " FX -" + (lst_Q[i - 1] / jntLst.Count).ToString("f3"); } ASTRA_Data.Add(kStr); } } //if (rbtn_fz_positive.Checked) //{ // kStr = kStr + " FZ "; //} ASTRA_Data.Add(kStr); if (Node != null) { if (btn_add.Text == "Change") { //Node = Node.Parent; //Node.Parent.Nodes.Clear(); Node.Text = "JOINT LOAD"; //var nd = Node.Nodes.Add("JOINT LOAD"); foreach (var item in ASTRA_Data) { Node.Nodes.Add(item); } //nd.Nodes.Add( this.Close(); } else { //Node.Text = "JOINT LOAD"; var nd = Node.Nodes.Add("JOINT LOAD"); foreach (var item in ASTRA_Data) { nd.Nodes.Add(item); } //Node.Nodes.Add(kStr); //Node.Expand(); Node.ExpandAll(); } } //else //{ this.Close(); //} }