public void Load_Floor_Levels() { if (DGV_Joints == null) { return; } BeamTable = new Hashtable(); AllColumn = new List <int>(); selected_beams = new List <int>(); selected_columns = new List <int>(); List <double> flvls = new List <double>(); double d = 0.0; //JointCoordinateCollection //MemberIncidenceCollection MemberIncidence mi = new MemberIncidence(); //MemberIncidenceCollection mic = new MemberIncidenceCollection(); JointCoordinate jc = new JointCoordinate(); //JointCoordinateCollection jcc = new JointCoordinateCollection(); List <int> selected_mems = MyStrings.Get_Array_Intiger(kStr); for (int i = 0; i < DGV_Joints.RowCount; i++) { jc = new JointCoordinate(); jc.NodeNo = MyStrings.StringToInt(DGV_Joints[0, i].Value.ToString(), 0); jc.X = MyStrings.StringToDouble(DGV_Joints[1, i].Value.ToString(), 0.0); jc.Y = MyStrings.StringToDouble(DGV_Joints[2, i].Value.ToString(), 0.0); jc.Z = MyStrings.StringToDouble(DGV_Joints[3, i].Value.ToString(), 0.0); jcc.Add(jc); } for (int i = 0; i < DGV_Members.RowCount; i++) { mi = new MemberIncidence(); mi.MemberNo = MyStrings.StringToInt(DGV_Members[0, i].Value.ToString(), 0); //jc.X = MyStrings.StringToDouble(DGV_Members[1, i].Value.ToString(), 0.0); mi.StartNode.NodeNo = MyStrings.StringToInt(DGV_Members[2, i].Value.ToString(), 0); mi.EndNode.NodeNo = MyStrings.StringToInt(DGV_Members[3, i].Value.ToString(), 0); mic.Add(mi); } mic.CopyJointCoordinates(jcc); foreach (var item in mic) { if (item.StartNode.Y == item.EndNode.Y) { if (selected_mems.Contains(item.MemberNo)) { selected_beams.Add(item.MemberNo); } d = item.StartNode.Y; if (!flvls.Contains(d)) { flvls.Add(d); //cmb_floor_levels.Items.Add(d.ToString("f3")); } } else if (item.StartNode.X == item.EndNode.X && item.StartNode.Z == item.EndNode.Z) { if (selected_mems.Contains(item.MemberNo)) { selected_columns.Add(item.MemberNo); } AllColumn.Add(item.MemberNo); } } flvls.Sort(); List <int> mems = new List <int>(); List <int> all_beams = new List <int>(); foreach (var lvl in flvls) { cmb_floor_levels.Items.Add(lvl.ToString("f3")); mems = new List <int>(); foreach (var item in mic) { if (item.StartNode.Y == item.EndNode.Y) { d = item.StartNode.Y; if (lvl == d) { mems.Add(item.MemberNo); } } } BeamTable.Add(lvl.ToString("f3"), mems); all_beams.AddRange(mems.ToArray()); } BeamTable.Add("all", all_beams); }
public List <int> Get_Continuous_Members(MemberIncidence b1, ref JointCoordinateCollection cont_jcc) { //JointCoordinateCollection cont_jcc = new JointCoordinateCollection(); MemberIncidenceCollection mbr_coll = new MemberIncidenceCollection(); if (b1 == null) { return(new List <int>()); } List <MemberIncidence> list = new List <MemberIncidence>(); JointCoordinateCollection jcc = new JointCoordinateCollection(); jcc.Add(b1.StartNode); jcc.Add(b1.EndNode); MemberIncidenceCollection mic1 = new MemberIncidenceCollection(); MemberIncidenceCollection mic2 = new MemberIncidenceCollection(); //MemberIncidenceCollection mic3 = new MemberIncidenceCollection(); MemberIncidenceCollection mic4 = new MemberIncidenceCollection(); foreach (var item in AST_DOC.Members) { if (item.EndNode.NodeNo == jcc[0].NodeNo || item.StartNode.NodeNo == jcc[0].NodeNo) { mic1.Add(item); } if (item.EndNode.NodeNo == jcc[1].NodeNo || item.StartNode.NodeNo == jcc[1].NodeNo) { mic2.Add(item); } } //if (jcc[0].NodeNo < jcc[1].NodeNo) //{ // if (!cont_jcc.Contains(jcc[1])) // { // cont_jcc.Add(jcc[1]); // } //} cont_jcc.Add(jcc[0]); cont_jcc.Add(jcc[1]); int flag = 0; mbr_coll.Add(b1); while (flag <= 1) { for (int i = 0; i < AST_DOC.Members.Count; i++) { foreach (var item in AST_DOC.Members) { if (b1.Direction == item.Direction) { if (item.StartNode.NodeNo == cont_jcc[cont_jcc.Count - 1].NodeNo) { if (!cont_jcc.Contains(item.EndNode)) { mbr_coll.Add(item); cont_jcc.Add(item.EndNode); i = 0; break; } } if (item.EndNode.NodeNo == cont_jcc[cont_jcc.Count - 1].NodeNo) { if (!cont_jcc.Contains(item.StartNode)) { mbr_coll.Add(item); cont_jcc.Add(item.StartNode); i = 0; break; } } } } } if (mbr_coll.Count == 1) { cont_jcc.Clear(); cont_jcc.Add(jcc[1]); cont_jcc.Add(jcc[0]); } else { break; } flag++; } List <int> mls = new List <int>(); foreach (var item in mbr_coll) { mls.Add(item.MemberNo); } return(mls); }
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(); //} }
public void Set_AS() { int i = 0; list_x.Clear(); list_y.Clear(); list_z.Clear(); hash_XY.Clear(); hash_XZ.Clear(); hash_YX.Clear(); hash_YZ.Clear(); hash_ZX.Clear(); hash_ZY.Clear(); 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; 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 Hashtable(); hash_ZY = new 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); } }
private void btn_OK_Click(object sender, EventArgs e) { MyStrings ml = new MyStrings(txt_beam_nos.Text.Trim(), ','); if (ml.Count > 0) { Slab_des.Beam_Nos = ml.StringList[0].Trim(); } else { MessageBox.Show("Slab Members is not defined.", "ASTRA", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } //Slab_des.Beam_Nos = txt_beam_nos.Text; Slab_des.case_index = cmb_slab_type.SelectedIndex; Slab_des.D = MyStrings.StringToDouble(txt_slab_D.Text, 0.0); Slab_des.fck = MyStrings.StringToDouble(cmb_slab_fck.Text.Replace("M", ""), 0.0); Slab_des.gamma = MyStrings.StringToDouble(txt_slab_gamma.Text, 0.0); Slab_des.fy = MyStrings.StringToDouble(cmb_slab_fy.Text.Replace("Fe", ""), 0.0); Slab_des.wll = MyStrings.StringToDouble(txt_slab_wll.Text, 0.0); Slab_des.d1 = MyStrings.StringToDouble(txt_slab_d1.Text, 0.0); Slab_des.s1 = MyStrings.StringToDouble(txt_slab_s1.Text, 0.0); Slab_des.d2 = MyStrings.StringToDouble(txt_slab_d2.Text, 0.0); Slab_des.s2 = MyStrings.StringToDouble(txt_slab_s2.Text, 0.0); Slab_des.d3 = MyStrings.StringToDouble(txt_slab_d3.Text, 0.0); Slab_des.s3 = MyStrings.StringToDouble(txt_slab_s3.Text, 0.0); Slab_des.d4 = MyStrings.StringToDouble(txt_slab_d4.Text, 0.0); Slab_des.s4 = MyStrings.StringToDouble(txt_slab_s4.Text, 0.0); Slab_des.cover = MyStrings.StringToDouble(txt_slab_c.Text, 0.0); Slab_des.dlf = MyStrings.StringToDouble(txt_slab_DLF.Text, 0.0); Slab_des.llf = MyStrings.StringToDouble(txt_slab_LLF.Text, 0.0); Slab_des.dgv_dls = dgv_dls; #region Check Beam Members MyStrings mlist = new MyStrings(txt_beam_nos.Text.Trim(), ' '); MemberIncidenceCollection mic = new MemberIncidenceCollection(); for (int i = 0; i < mlist.Count; i++) { mic.Add(AST_DOC.Members.Get_Member(mlist.GetInt(i))); } JointCoordinateCollection jntc = new JointCoordinateCollection(); for (int i = 1; i < mic.Count; i++) { if (mic[i - 1].StartNode == mic[i].StartNode) { if (!jntc.Contains(mic[i].StartNode)) { jntc.Add(mic[i].StartNode); } } else if (mic[i - 1].EndNode == mic[i].StartNode) { if (!jntc.Contains(mic[i].StartNode)) { jntc.Add(mic[i].StartNode); } } else if (mic[i - 1].StartNode == mic[i].EndNode) { if (!jntc.Contains(mic[i].EndNode)) { jntc.Add(mic[i].EndNode); } } else if (mic[i - 1].EndNode == mic[i].EndNode) { if (!jntc.Contains(mic[i].EndNode)) { jntc.Add(mic[i].EndNode); } } else { //string ss = Slab_Data[beam_nos] as string; //if (ss != null) // Slab_Data.Remove(beam_nos); //Save_Data(); MessageBox.Show("Beam " + mic[i].MemberNo + " and Beam " + mic[i - 1].MemberNo + " Joints are mismatch..", "ASTRA", MessageBoxButtons.OK); return; } } #endregion Check Beam Members //Chiranjit [2015 04 26] //Slab_des.Calculate_Program(); Slab_des.Design_Program(); List <string> Design_Summary = new List <string>(); Design_Summary.Add(string.Format("-------------------------------------")); Design_Summary.Add(string.Format("SLAB MEMBERS = {0}", Slab_des.Beam_Nos)); Design_Summary.Add(string.Format("SLAB FLOOR LEVEL = {0} M", cmb_flr_lvl.Text)); Design_Summary.AddRange(Slab_des.Design_Summary.ToArray()); Design_Summary.Add(string.Format("-------------------------------------")); string fnm = Slab_des.Get_Design_Summary_File(Slab_des.Beam_Nos, cmb_flr_lvl.Text); //fnm = Path.Combine(Path.GetDirectoryName(fnm), "SLAB_DESIGN_SUMMARY.TXT"); //if (File.Exists(fnm)) // Design_Summary.AddRange(File.ReadAllLines(fnm)); File.WriteAllLines(fnm, Design_Summary.ToArray()); Save_Data(); //Fill_Slab(txt_beam_nos.Text, Slab_des.IS_DESIGN_OK); Fill_All_Slab(); Add_Slab_Boq(Slab_des.BOQ); GetGripSelection(false).RemoveAll(); if (File.Exists(Slab_des.Report_File)) { MessageBox.Show(this, "Report file created in file " + Slab_des.Report_File, "ASTRA", MessageBoxButtons.OK); frmASTRAReport.OpenReport(Slab_des.Report_File, this, false); } VDoc.Redraw(true); //this.DialogResult = DialogResult.OK; //this.Close(); }
private void Get_Beams() { double d = MyStrings.StringToDouble(cmb_flr_lvl.Text, 0.0); VDoc.ActiveLayOut.Entities.RemoveAll(); panel1.Visible = true; MemberIncidenceCollection mic = new MemberIncidenceCollection(); JointCoordinateCollection jcc = new JointCoordinateCollection(); MemberIncidence mi; foreach (var item in AST_DOC.Members) { if (item.StartNode.Y == d && item.EndNode.Y == d) { //mi = new MemberIncidence(); //mi.StartNode = new JointCoordinate(item.StartNode); //mi.EndNode = new JointCoordinate(item.EndNode); //mi.MemberNo = item.MemberNo; //mi.StartNode.Y = mi.StartNode.Z; //mi.EndNode.Y = mi.EndNode.Z; AST_DOC.Members.DrawMember(item, VDoc, TXT_SIZE); //AST_DOC.Members.DrawMember(mi, VDoc, TXT_SIZE); mic.Add(item); if (!jcc.Contains(item.StartNode)) { jcc.Add(item.StartNode); } if (!jcc.Contains(item.EndNode)) { jcc.Add(item.EndNode); } } } jcc.DrawJointsText(VDoc, TXT_SIZE); VDoc.Layers.FindName("Members").Lock = true; VDoc.Layers.FindName("Nodes").Lock = true; //VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VTop(VDoc); Set_TextSize(); //Get_Slabs(mic); Fill_All_Slab(); Load_Slab_Data(); VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_VBack(VDoc); VectorDraw.Professional.ActionUtilities.vdCommandAction.View3D_Vrot(VDoc); }
private void Fill_Slab(string beam_nos, bool isOk) { MyStrings mlist = new MyStrings(beam_nos.Trim(), ' '); MemberIncidenceCollection mic = new MemberIncidenceCollection(); for (int i = 0; i < mlist.Count; i++) { mic.Add(AST_DOC.Members.Get_Member(mlist.GetInt(i))); } JointCoordinateCollection jntc = new JointCoordinateCollection(); vdPolyline vdpl = new vdPolyline(); vdpl.SetUnRegisterDocument(VDoc); vdpl.setDocumentDefaults(); for (int i = 1; i < mic.Count; i++) { if (mic[i - 1].StartNode == mic[i].StartNode) { if (!jntc.Contains(mic[i].StartNode)) { jntc.Add(mic[i].StartNode); } } else if (mic[i - 1].EndNode == mic[i].StartNode) { if (!jntc.Contains(mic[i].StartNode)) { jntc.Add(mic[i].StartNode); } } else if (mic[i - 1].StartNode == mic[i].EndNode) { if (!jntc.Contains(mic[i].EndNode)) { jntc.Add(mic[i].EndNode); } } else if (mic[i - 1].EndNode == mic[i].EndNode) { if (!jntc.Contains(mic[i].EndNode)) { jntc.Add(mic[i].EndNode); } } else { //string ss = Slab_Data[beam_nos] as string; //if (ss != null) // Slab_Data.Remove(beam_nos); //Save_Data(); MessageBox.Show("Beam " + mic[i].MemberNo + " and Beam " + mic[i - 1].MemberNo + " Joints are mismatch..", "ASTRA", MessageBoxButtons.OK); return; } } if (!jntc.Contains(mic[0].StartNode)) { jntc.Add(mic[0].StartNode); } if (!jntc.Contains(mic[0].EndNode)) { jntc.Add(mic[0].EndNode); } jntc.Add(jntc[0]); double max_z = AST_DOC.Joints.Max_Z_Positive; foreach (var item in jntc) { //vdpl.VertexList.Add(item.Point); vdpl.VertexList.Add(new gPoint(item.X, max_z - item.Z)); } //if (File.Exists(Slab_des.Get_Report_File(beam_nos, cmb_flr_lvl.Text))) //{ // vdpl.ToolTip = File.ReadAllText(Slab_des.Get_Report_File(beam_nos, cmb_flr_lvl.Text)); // vdpl.ToolTip = " //} vdpl.ToolTip = "Member surrounded : " + beam_nos; vdLayer vlay = VDoc.Layers.FindName("slab"); if (vlay == null) { vlay = new vdLayer(VDoc, "slab"); vlay.SetUnRegisterDocument(VDoc); vlay.setDocumentDefaults(); VDoc.Layers.Add(vlay); } //vlay.Frozen = false; //vlay.Lock = true; vdpl.Layer = vlay; //vdpl.PenColor = new vdColor(Color.DarkGray); if (isOk) { vdpl.PenColor = new vdColor(Color.Green); } else { vdpl.PenColor = new vdColor(Color.Red); } vdpl.HatchProperties = new vdHatchProperties(VectorDraw.Professional.Constants.VdConstFill.VdFillModeHatchFDiagonal); //vdpl.ExtrusionVector = new Vector(0.0, 1.0, 0.0); VDoc.ActiveLayOut.Entities.Add(vdpl); VDoc.ActiveLayOut.Entities.ChangeOrder(vdpl, true); VDoc.Redraw(true); }