private void frmElements_Load(object sender, EventArgs e) { if (ASTRA_Data.Count > 0) { string kStr = ASTRA_Data[0]; MyStrings mlist = new MyStrings(MyStrings.RemoveAllSpaces(kStr), ' '); int r = MyStrings.StringToInt(kStr, -1); if (r == -1) { r = DGV.CurrentCell.RowIndex; btn_elmt_add.Text = "Insert"; txt_elmt_no.Text = DGV[0, r].Value.ToString(); } else { txt_elmt_no.Text = DGV[0, r].Value.ToString(); txt_elmt_node1.Text = DGV[1, r].Value.ToString(); txt_elmt_node2.Text = DGV[2, r].Value.ToString(); txt_elmt_node3.Text = DGV[3, r].Value.ToString(); txt_elmt_node4.Text = DGV[4, r].Value.ToString(); btn_elmt_add.Text = "Change"; } } else { txt_elmt_no.Text = DGV.RowCount + 1 + ""; List <int> joints = MyStrings.Get_Array_Intiger(iACad.GetSelectedJointsInText()); if (joints.Count > 3) { txt_elmt_node1.Text = joints[0].ToString(); txt_elmt_node2.Text = joints[1].ToString(); txt_elmt_node3.Text = joints[2].ToString(); txt_elmt_node4.Text = joints[3].ToString(); } //txt_elmt_node1.Text = "0"; //txt_elmt_node2.Text = "0.0"; //txt_jnt_start_z.Text = "0.0"; } }
public void Update_Data(string UpdText) { if (TRV == null) { return; } List <List <int> > list1 = new List <List <int> >(); List <int> mems = new List <int>(); List <int> Updmems = new List <int>(); //string UpdText = "1 TO 10 PR YD 0.410 ZD 0.32"; MyStrings mmls = new MyStrings(UpdText, ' '); int intx = 0; string kStr = ""; string PR = ""; for (intx = 0; intx < mmls.Count; intx++) { if (mmls.StringList[intx].StartsWith("PR")) { kStr = mmls.GetString(0, intx - 1); PR = mmls.GetString(intx); break; } } Updmems = MyStrings.Get_Array_Intiger(kStr); string PR_Upd = PR; for (int i = 0; i < TRV.Nodes.Count; i++) { //mems = MyStrings.Get_Array_Intiger(TRV.Nodes[i].Text); mmls = new MyStrings(TRV.Nodes[i].Text, ' '); intx = 0; kStr = ""; PR = ""; for (intx = 0; intx < mmls.Count; intx++) { if (mmls.StringList[intx].StartsWith("PR")) { kStr = mmls.GetString(0, intx - 1); PR = mmls.GetString(intx); break; } } mems = MyStrings.Get_Array_Intiger(kStr); foreach (var item in Updmems) { if (mems.Contains(item)) { mems.Remove(item); } } if (mems.Count > 0) { TRV.Nodes[i].Text = MyStrings.Get_Array_Text(mems) + " " + PR; } else { TRV.Nodes.RemoveAt(i); i--; } list1.Add(mems); } TRV.Nodes.Add(UpdText); //string kStr = ""; }
public void Update_Data(string UpdText) { if (TRV == null) { return; } List <List <int> > list1 = new List <List <int> >(); List <int> mems = new List <int>(); List <int> Updmems = new List <int>(); //string UpdText = "1 TO 10 PR YD 0.410 ZD 0.32"; MyStrings mmls = new MyStrings(UpdText, ' '); int intx = 0; string kStr = ""; string PR = ""; for (intx = 0; intx < mmls.Count; intx++) { if (mmls.StringList[intx].StartsWith("PR")) { kStr = mmls.GetString(0, intx - 1); PR = mmls.GetString(intx); break; } } Updmems = MyStrings.Get_Array_Intiger(kStr); string PR_Upd = PR; //MyStrings memGrp = new MyStrings(UpdText, ' '); string mat_str = kStr.Trim(); for (int i = 0; i < TRV.Nodes.Count; i++) { //mems = MyStrings.Get_Array_Intiger(TRV.Nodes[i].Text); mmls = new MyStrings(TRV.Nodes[i].Text, ' '); if (Updmems.Count > 0) { intx = 0; kStr = ""; PR = ""; for (intx = 0; intx < mmls.Count; intx++) { if (mmls.StringList[intx].StartsWith("PR")) { kStr = mmls.GetString(0, intx - 1); PR = mmls.GetString(intx); break; } } mems = MyStrings.Get_Array_Intiger(kStr); if (mems.Count > 0) { foreach (var item in Updmems) { if (mems.Contains(item)) { mems.Remove(item); } } if (mems.Count > 0) { TRV.Nodes[i].Text = MyStrings.Get_Array_Text(mems) + " " + PR; } else { TRV.Nodes.RemoveAt(i); i--; } list1.Add(mems); } } else { if (mmls.StringList[0] == mat_str) { TRV.Nodes[i].Text = UpdText; //TRV.Nodes.RemoveAt(i); goto _ss; } } } TRV.Nodes.Add(UpdText); _ss: iACad.AstraDocument.MemberProperties.AddTxt(UpdText); iACad.AstraDocument.MemberProperties.CopyMemberIncidence(iACad.AstraDocument.Members); }
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); }
private void btnOk_Click(object sender, EventArgs e) { ASTRA_Data.Clear(); kStr = "PERFORM TIME HISTORY ANALYSIS"; ASTRA_Data.Add(kStr); //iACad.WriteFile(kStr, true); kStr = string.Format("FREQUENCIES {0}", txtTotalFrequencies.Text); ASTRA_Data.Add(kStr); //iACad.WriteFile(kStr, true); kStr = string.Format("TIME STEPS {0}", txtTimeSteps.Text); ASTRA_Data.Add(kStr); //iACad.WriteFile(kStr, true); kStr = string.Format("PRINT INTERVAL {0}", txtPrintInterval.Text); ASTRA_Data.Add(kStr); //iACad.WriteFile(kStr, true); kStr = string.Format("STEP INTERVAL {0}", txtStepInterval.Text); ASTRA_Data.Add(kStr); //iACad.WriteFile(kStr, true); kStr = string.Format("DUMPING FACTOR {0}", txtDampingFactor.Text); ASTRA_Data.Add(kStr); //iACad.WriteFile(kStr, true); kStr = string.Format("GROUND MOTION {0}", cmbGroundMotion.Text); ASTRA_Data.Add(kStr); //iACad.WriteFile(kStr, true); kStr = string.Format("X DIVISION {0}", txtXDivision.Text); ASTRA_Data.Add(kStr); //iACad.WriteFile(kStr, true); kStr = string.Format("SCALE FACTOR {0}", txtScaleFactor.Text); ASTRA_Data.Add(kStr); //iACad.WriteFile(kStr, true); kStr = txtTimeValues.Text.Replace(',', ' ').Trim(); kStr = string.Format("TIME VALUES {0}", kStr); ASTRA_Data.Add(kStr); //iACad.WriteFile(kStr, true); kStr = txtTimeFunction.Text.Replace(',', ' ').Trim(); kStr = string.Format("TIME FUNCTION {0}", kStr); ASTRA_Data.Add(kStr); //iACad.WriteFile(kStr, true); if (chkNodalConstraint.Checked) { kStr = string.Format("NODAL CONSTRAINT DOF", txtTimeFunction.Text); ASTRA_Data.Add(kStr); //iACad.WriteFile(kStr, true); kStr = txtNodeNumbers.Text.Replace(',', ' '); MyStrings mList = new MyStrings(kStr, ' '); string movement = ""; #region MOVEMENT if (chkTx.Checked) { movement = "TX "; } if (chkTy.Checked) { movement += "TY "; } if (chkTz.Checked) { movement += "TZ "; } if (chkRx.Checked) { movement += "RX "; } if (chkRy.Checked) { movement += "RY "; } if (chkRz.Checked) { movement += "RZ "; } #endregion foreach (var item in MyStrings.Get_Array_Intiger(kStr)) { kStr = string.Format("{0} {1}", item, movement); ASTRA_Data.Add(kStr); } } else { } kStr = "MEMBER STRESS COMPONENT"; ASTRA_Data.Add(kStr); //iACad.WriteFile(kStr, true); kStr = string.Format("{0} {1}", txtMemberNumbers.Text, ((rbtnStart.Checked == true) ? "START" : "END")); ASTRA_Data.Add(kStr); //iACad.WriteFile(kStr, true); this.Close(); }