private void bt_Go_Click(object sender, EventArgs e) { string LcN = cb_LC.SelectedItem.ToString(); //选择的工况 double Mag = double.Parse(tb_mag.Text); //放大倍数 //选择的节点集 List <int> nodes = SelectCollection.StringToList(rtb_midasin.Text); int Num_modified = 0;//记录修改的节点数 //修改荷载 foreach (int nn in nodes) { SortedList NLD = this.CurModle.LoadTable.NLoadData[LcN] as SortedList; if (NLD.ContainsKey(nn)) { this.CurModle.LoadTable.ModifyNodeLoad(nn, LcN, Mag); Num_modified++; } } //输出命令行 string t1 = string.Format("{0}{1}个节点荷载已经进行了放大!", Environment.NewLine, Num_modified); this.MessTool.Tb_out.AppendText(t1); string t2 = string.Format("{0}下面输出3d3s10.1版本文本文件:", Environment.NewLine); this.MessTool.Tb_out.AppendText(t2); int nodeloadlibN = 4599; //目前节点荷载库中节点荷载序号 string lctype = "0"; //临时变量:工况类型0,1,2 foreach (int nn in nodes) { SortedList NLD = this.CurModle.LoadTable.NLoadData[LcN] as SortedList; if (NLD.ContainsKey(nn)) { BNLoad bnl = NLD[nn] as BNLoad; string s1 = string.Format("{0}PL {1} {2} {3} {4} {5} {6} {7} {8}", Environment.NewLine, lctype, LcN, bnl.FX, bnl.FY, bnl.FZ, bnl.MX, bnl.MY, bnl.MZ); string s2 = string.Format("{0}APL {1} {2}", Environment.NewLine, nn, nodeloadlibN++); this.MessTool.Tb_out.AppendText(s1); this.MessTool.Tb_out.AppendText(s2); } } }
/// <summary> /// 读取节点信息表“节点荷载” /// </summary> /// <param name="ws">工作表</param> /// <param name="mm">读入的数据库</param> public void ReadNode2(Worksheet ws, ref Bmodel mm) { int iFrow = ws.Cells.FirstRowIndex; //起始行 int iLrow = ws.Cells.LastRowIndex; //终止行 for (int i = iFrow + 1; i <= iLrow; i++) { Row CurRow = ws.Cells.GetRow(i); //当前行 int inode = int.Parse(CurRow.GetCell(0).StringValue); string lc = CurRow.GetCell(3).StringValue; //工况名称 double Px = double.Parse(CurRow.GetCell(4).StringValue); //荷载数据 double Py = double.Parse(CurRow.GetCell(5).StringValue); double Pz = double.Parse(CurRow.GetCell(6).StringValue); double Mx = double.Parse(CurRow.GetCell(7).StringValue); double My = double.Parse(CurRow.GetCell(8).StringValue); double Mz = double.Parse(CurRow.GetCell(9).StringValue); BNLoad nld = new BNLoad(inode); nld.LC = lc; nld.SetLoadValue(Px, Py, Pz, Mx, My, Mz); mm.AddNodeLoad(nld); } }