// Dictionary<string, double> Results = new Dictionary<string, double>(); public void ReadDXF(string dxfFileName, ref Section section) { mds = new MesherDataSet(); string filename = dxfFileName; List <Polygon> polygons = getArea(filename); double d = 0.0; double[] aluFrame1dim = singledepth(polygons.ElementAt(0)); double[] aluFrame2dim = singledepth(polygons.ElementAt(1)); if (aluFrame1dim[2] > aluFrame2dim[2]) { d = aluFrame1dim[2] - aluFrame2dim[3]; } else { d = aluFrame2dim[2] - aluFrame1dim[3]; } section.d = d / 10; double Zoo = 0.0; double Zou = 0.0; double Zuo = 0.0; double Zuu = 0.0; for (int i = 0; i < polygons.Count; i++) { poly = polygons.ElementAt(i); mesh = DxfMesh(poly); // compute mesh basic property MesherBasicProperty(); double[] Z = singledepth(poly); if (i == 0) { Zoo = Z.ElementAt(0); Zou = Z.ElementAt(1); section.Zoo = Zoo / 10; section.Zou = Zou / 10; section.Ao = mds.totalMeshArea / 100; section.Io = mds.meshIxxC / 10000; section.Ioyy = mds.meshIyyC / 10000; // by Wei section.Wo = 9.80665 / 100 * mds.totalMeshArea / 100 * 100 * 2.7 / 1000; // weight in N/cm } else if (i == 1) { Zuo = Z.ElementAt(0); Zuu = Z.ElementAt(1); section.Zuo = Zuo / 10; section.Zuu = Zuu / 10; section.Au = mds.totalMeshArea / 100; section.Iu = mds.meshIxxC / 10000; section.Iuyy = mds.meshIyyC / 10000; // by Wei section.Wu = 9.80665 / 100 * mds.totalMeshArea / 100 * 100 * 2.7 / 1000; // weight in N/cm } else if (i == 2) { section.Wl = 9.80665 / 100 * mds.totalMeshArea / 100 * 100 * 1.2 * 1.27 / 1000; } else if (i == 3) { section.Wr = 9.80665 / 100 * mds.totalMeshArea / 100 * 100 * 1.2 * 1.27 / 1000; } } section.Weight = section.Wo + section.Wu + section.Wl + section.Wr; }
// Dictionary<string, double> Results = new Dictionary<string, double>(); public void ReadDXF(string dxfFileName, ref Section section) { mds = new MesherDataSet(); string filename = dxfFileName; List <Polygon> polygons = getArea(filename); double d = dxfPolydepth(filename); section.d = d / 10; double Zoo = 0.0; double Zou = 0.0; double Zuo = 0.0; double Zuu = 0.0; for (int i = 0; i < polygons.Count; i++) { poly = polygons.ElementAt(i); mesh = DxfMesh(poly); // compute mesh basic property MesherBasicProperty(); double[] Z = singledepth(poly); if (i == 0) { Zoo = Z.ElementAt(0); Zou = Z.ElementAt(1); section.Zoo = Zoo / 10; section.Zou = Zou / 10; section.Ao = mds.totalMeshArea / 100; section.Io = mds.meshIxxC / 10000; section.Ioyy = mds.meshIyyC / 10000; // by Wei section.Wo = 9.80665 / 100 * mds.totalMeshArea / 100 * 100 * 2.7 / 1000; // weight in N/cm } else if (i == 1) { Zuo = Z.ElementAt(0); Zuu = Z.ElementAt(1); section.Zuo = Zuo / 10; section.Zuu = Zuu / 10; section.Au = mds.totalMeshArea / 100; section.Iu = mds.meshIxxC / 10000; section.Iuyy = mds.meshIyyC / 10000; // by Wei section.Wu = 9.80665 / 100 * mds.totalMeshArea / 100 * 100 * 2.7 / 1000; // weight in N/cm } else if (i == 2) { section.Wl = 9.80665 / 100 * mds.totalMeshArea / 100 * 100 * 1.2 * 1.27 / 1000; } else if (i == 3) { section.Wr = 9.80665 / 100 * mds.totalMeshArea / 100 * 100 * 1.2 * 1.27 / 1000; } } section.Weight = section.Wo + section.Wu + section.Wl + section.Wr; //double a = d - Zoo - Zuu; //Results.Add("a", a / 10); //double ao = (Results["Au"] * a) / (Results["Au"] + Results["Ao"]); //double au = a - ao; //Results.Add("ao", ao / 10); //Results.Add("au", au / 10); }