public static Polyline Plot11(Database db, Point2d AnchorPoint, Dalot curDalot, double hp = 0.01, double footWidht = 400) { Polyline PL1 = new Polyline() { Closed = true }; using (Transaction tr = db.TransactionManager.StartTransaction()) { BlockTable blockTbl = tr.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable; BlockTableRecord modelSpace = tr.GetObject(blockTbl[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord; Line2d AxisY = new Line2d(AnchorPoint, AnchorPoint.Convert2D(0, 1)); Point2d p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10; p0 = AnchorPoint.Convert2D(-0.5 * curDalot.Sect[0] - footWidht, 0); p1 = p0.Mirror(AxisY); p2 = p1.Convert2D(0, curDalot.Sect[4]); if (footWidht == 0) { p3 = p2.Convert2D(-footWidht + 0); p4 = p3.Convert2D(0, curDalot.Sect[7]); } else { p3 = p2.Convert2D(-footWidht + curDalot.Sect[6]); p4 = p3.Convert2D(-curDalot.Sect[6], curDalot.Sect[7]); } p5 = p1.Convert2D(-footWidht, curDalot.Sect[2]); p6 = AnchorPoint.Convert2D(0, curDalot.Sect[2] + 0.5 * curDalot.Sect[2] * hp); p7 = p5.Mirror(AxisY); p8 = p4.Mirror(AxisY); p9 = p3.Mirror(AxisY); p10 = p2.Mirror(AxisY); PL1.AddVertexAt(0, p0, 0, 0, 0); PL1.AddVertexAt(1, p1, 0, 0, 0); PL1.AddVertexAt(2, p2, 0, 0, 0); PL1.AddVertexAt(3, p3, 0, 0, 0); PL1.AddVertexAt(4, p4, 0, 0, 0); PL1.AddVertexAt(5, p5, 0, 0, 0); PL1.AddVertexAt(6, p6, 0, 0, 0); PL1.AddVertexAt(7, p7, 0, 0, 0); PL1.AddVertexAt(8, p8, 0, 0, 0); PL1.AddVertexAt(9, p9, 0, 0, 0); PL1.AddVertexAt(10, p10, 0, 0, 0); modelSpace.AppendEntity(PL1); tr.AddNewlyCreatedDBObject(PL1, true); tr.Commit(); } return(PL1); }
private DMT DmtLookUp(List <DMT> repo, string pk) { DMT res = new DMT(); double pk_double = Dalot.PkString2Double(pk); foreach (DMT item in repo) { double target = Dalot.PkString2Double(item.pk_string); if (Dalot.PkString2Double(item.pk_string) == Dalot.PkString2Double(pk)) { res = item; } } return(res); }
/// <summary> /// 初始化地质图列表-根据一航数据 /// </summary> /// <param name="filepath"></param> /// <returns></returns> private List <DZT> IniDZT2(string filepath) { var DZT_Csv = BPublicFunctions.OpenCSV(filepath).AsEnumerable(); List <DZT> result = new List <DZT>(); string datpath = Path.ChangeExtension(filepath, "dzt"); StreamReader sR = File.OpenText(datpath); DZT item = new DZT(); Tuple <string, double> tuple = new Tuple <string, double>("", 0.0); List <Tuple <string, double> > theBGList = new List <Tuple <string, double> >(); string Content = sR.ReadToEnd(); sR.Close(); List <string> AllLines = Regex.Split(Content, "\r\n", RegexOptions.IgnoreCase).ToList(); foreach (string lines in AllLines) { int i = AllLines.IndexOf(lines); if (lines.StartsWith("HD")) { // 初始化暂存 theBGList = new List <Tuple <string, double> >(); item = new DZT(); // 查询桩号 var ff = from row in DZT_Csv where row["孔号"].ToString() == lines select row["中心桩号"].ToString(); if (ff.Count() == 0) { continue; } item.pk_double = Dalot.PkString2Double(ff.First()); item.kongkou = double.Parse(AllLines[i - 1]); List <string> layers = new List <string>(); for (int j = 0; Regex.IsMatch(AllLines[i + 4 + j], "[\u4e00-\u9fbb]"); j++) { layers.Add(AllLines[i + 4 + j].Split(':')[0]); } for (int j = 0; j < layers.Count(); j++) { tuple = new Tuple <string, double>(layers[j], double.Parse(AllLines[i + 3 + layers.Count() + 1 + j])); theBGList.Add(tuple); } item.DZBG = theBGList; result.Add(item); } } return(result); }
/// <summary> /// 地质图检索 /// </summary> /// <param name="repo">地质图列表</param> /// <param name="pk">里程(字符串)</param> /// <returns></returns> private DZT DztLookUp(List <DZT> repo, string pk) { DZT res = new DZT(); double aim = Dalot.PkString2Double(pk); var dist = from item in repo select Math.Abs(item.pk_double - aim); double dist_min = dist.Min(); foreach (DZT item in repo) { if (Math.Abs(item.pk_double - aim) - dist_min < 0.001) { res = item; break; } } return(res); }
/// <summary> /// 初始化涵洞对象 /// </summary> /// <param name="theDT">数据表</param> /// <param name="DalotId">涵洞索引号</param> /// <returns></returns> public Dalot GetDalotFromDataTable(System.Data.DataTable theDT, int DalotId) { var results = from myRow in theDT.AsEnumerable() where myRow.Field <int>("id") == DalotId select myRow; var theData = results.First(); string Pk = (string)theData["pk"]; double Ang = 90.0 - (double)theData["Ang"]; double Slop = (double)theData["slop"]; double Length = (double)theData["Length"] * 1000.0; double SegLength = (double)theData["SegLength"] * 1000.0; double XMidDist = (double)theData["XMidLength"] * 1000.0; int no = DalotId; double H0 = (double)theData["H0"]; double c = (double)theData["c"]; double w = (double)theData["w"]; double h = (double)theData["h"]; string design = (string)theData["DesignNo"]; DType theType = DType.A; if (c == 1) { if (w == 1.5) { theType = DType.A; } else if (w == 2.0) { theType = DType.B; } else if (w == 4.0) { if (h == 2.0) { theType = DType.C; } else { theType = DType.D; } } } else if (c == 2) { //两孔 if (w == 2.0) { theType = DType.F; } else if (w == 3.0) { theType = DType.G; } } else { theType = DType.A; } AType cAtype = AType.BZQ; string amonttype = (string)theData["Amont"]; if (amonttype == "八字墙") { cAtype = AType.BZQ; } else if (amonttype == "集水井") { cAtype = AType.JSJ; } bool cistri = true; //public AType Amont, Avale; //public DType DalotType; Point2d BasePoint = new Point2d(0, no * -50000); double LayerThick = (double)theData["LayerThick"]; double LayerWidth = (double)theData["LayerWidth"]; int sA = (int)(double)theData["ScaleA"]; int sB = (int)(double)theData["ScaleB"]; Dalot res = new Dalot(Dalot.PkString2Double(Pk), Ang, Slop, Length, SegLength, XMidDist, theType, cAtype, BasePoint, LayerThick, LayerWidth, H0, sA, sB, cistri, design); return(res); }
public static void PrintNumTitle(Database db, Point3d PaperOrigenPoint, Dalot curDalot) { using (Transaction tr = db.TransactionManager.StartTransaction()) { TextStyleTable st = tr.GetObject(db.TextStyleTableId, OpenMode.ForRead) as TextStyleTable; BlockTable blockTbl = tr.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable; BlockTableRecord recorder = tr.GetObject(blockTbl[BlockTableRecord.PaperSpace], OpenMode.ForWrite) as BlockTableRecord; for (int i = 0; i <= 1; i++) { DBText num = new DBText(); num.TextString = "1"; num.Height = 2.5; if (i == 0) { num.Position = PaperOrigenPoint.Convert3D(394.817, 283.25); } else { num.Position = PaperOrigenPoint.Convert3D(404.939, 283.25); } num.HorizontalMode = TextHorizontalMode.TextCenter; num.VerticalMode = TextVerticalMode.TextVerticalMid; num.AlignmentPoint = num.Position; num.Layer = "标注"; num.TextStyleId = st["En"]; num.WidthFactor = 0.85; recorder.AppendEntity(num); tr.AddNewlyCreatedDBObject(num, true); } // 标题 DBText title = new DBText(); if (curDalot.DalotType == DType.A) { title.TextString = "PLAN DE COFFRAGE DU DALOT (1-1.5×1.0m)"; } else if (curDalot.DalotType == DType.B) { title.TextString = "PLAN DE COFFRAGE DU DALOT (1-2.0×1.5m)"; } else if (curDalot.DalotType == DType.C) { title.TextString = "PLAN DE COFFRAGE DU DALOT (1-4.0×2.0m)"; } else if (curDalot.DalotType == DType.D) { title.TextString = "PLAN DE COFFRAGE DU DALOT (1-4.0×3.0m)"; } else { return; } title.Height = 3.5; title.Position = PaperOrigenPoint.Convert3D(254.5391, 21.4013); title.HorizontalMode = TextHorizontalMode.TextCenter; title.VerticalMode = TextVerticalMode.TextVerticalMid; title.AlignmentPoint = title.Position; title.Layer = "标注"; title.TextStyleId = st["En"]; title.WidthFactor = 0.8; recorder.AppendEntity(title); tr.AddNewlyCreatedDBObject(title, true); title = new DBText(); title.TextString = curDalot.Pk_string(); title.Height = 3.5; title.Position = PaperOrigenPoint.Convert3D(254.5391, 15.2987); title.HorizontalMode = TextHorizontalMode.TextCenter; title.VerticalMode = TextVerticalMode.TextVerticalMid; title.AlignmentPoint = title.Position; title.Layer = "标注"; title.TextStyleId = st["En"]; title.WidthFactor = 0.8; recorder.AppendEntity(title); tr.AddNewlyCreatedDBObject(title, true); // 图号 DBText dn = new DBText(); dn.TextString = curDalot.DesignNo; dn.Height = 2.5; dn.Position = PaperOrigenPoint.Convert3D(371, 14); dn.HorizontalMode = TextHorizontalMode.TextCenter; dn.VerticalMode = TextVerticalMode.TextVerticalMid; dn.AlignmentPoint = dn.Position; dn.Layer = "标注"; dn.TextStyleId = st["En"]; dn.WidthFactor = 0.8; recorder.AppendEntity(dn); tr.AddNewlyCreatedDBObject(dn, true); tr.Commit(); } return; }
public static void PrintTable(Database db, Point3d PaperOrigenPoint, Dalot curDatlotObj, DMT curDMT, System.Data.DataTable curParas, double [] AreaOfSection, MOExcel.Worksheet worksheet, int LineIdx) { double x0 = 284; double y_anchor = 267; double y0 = 0; double x1 = x0 + 106; double t1 = x0 + 24; double t2 = t1 + 38; double t3 = t2 + 17; double t4 = t3 + 16; int[] num23 = curDatlotObj.GetSegNum(); var results = from myRow in curParas.AsEnumerable() where Dalot.PkString2Double(myRow.Field <string>("pk")) == curDatlotObj.Pk select myRow; var theData = results.First(); using (Transaction tr = db.TransactionManager.StartTransaction()) { TextStyleTable st = tr.GetObject(db.TextStyleTableId, OpenMode.ForRead) as TextStyleTable; BlockTable blockTbl = tr.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable; BlockTableRecord recorder = tr.GetObject(blockTbl[BlockTableRecord.PaperSpace], OpenMode.ForWrite) as BlockTableRecord; DBText theTitle = new DBText(); theTitle.TextString = "TABLEAU QUANTITATIF DES DALOT " + curDatlotObj.Pk_string(); theTitle.Height = 3.5; theTitle.Position = PaperOrigenPoint.Convert3D((x0 + x1) * 0.5, y_anchor); theTitle.HorizontalMode = TextHorizontalMode.TextCenter; theTitle.VerticalMode = TextVerticalMode.TextBottom; theTitle.AlignmentPoint = theTitle.Position; theTitle.Layer = "标注"; theTitle.TextStyleId = st["En"]; theTitle.WidthFactor = 0.85; recorder.AppendEntity(theTitle); tr.AddNewlyCreatedDBObject(theTitle, true); DBText theTitleZh = new DBText(); theTitleZh.TextString = "涵洞材料数量表"; theTitleZh.Height = 5; theTitleZh.Position = PaperOrigenPoint.Convert3D((x0 + x1) * 0.5, y_anchor + 6); theTitleZh.HorizontalMode = TextHorizontalMode.TextCenter; theTitleZh.VerticalMode = TextVerticalMode.TextBottom; theTitleZh.AlignmentPoint = theTitleZh.Position; theTitleZh.Layer = "标注"; theTitleZh.TextStyleId = st["fsdb"]; theTitleZh.WidthFactor = 0.85; // 取消中文 //recorder.AppendEntity(theTitleZh); //tr.AddNewlyCreatedDBObject(theTitleZh, true); Dictionary <int, string[]> table = new Dictionary <int, string[]>(); double Conc = 0; double Steel = 0; int totalSegNum = 0; double bzqL = 0, jsjL = 0; double SectA = 0; double YiGeXiaoSanJiao = 0; double BZQfangshuiceng = 0; double JSJfangshuiceng = 0; if (curDatlotObj.DalotType == DType.A) { Conc = 2.0 * num23[0] * 1.18915 + 3.0 * num23[1] * 1.18915; Steel = num23[0] * (double)theData["2m钢筋量"] + num23[1] * (double)theData["3m钢筋量"]; totalSegNum = num23[0] + num23[1]; bzqL = 2.000; jsjL = 1.850; SectA = 1.18915; YiGeXiaoSanJiao = 2 * 2 * Math.Tan(30.0 / 180.0 * Math.PI) * 0.5; BZQfangshuiceng = 3.8; JSJfangshuiceng = 7.84; } else if (curDatlotObj.DalotType == DType.B) { Conc = curDatlotObj.Length / 1000 * 2.035; Steel = (double)theData["节段钢筋量"] * num23[0]; totalSegNum = num23[0]; bzqL = 2.825; jsjL = 1.900; SectA = 2.035; YiGeXiaoSanJiao = 2.82 * 2.82 * Math.Tan(30.0 / 180.0 * Math.PI) * 0.5; BZQfangshuiceng = 7; JSJfangshuiceng = 12.4; } else if (curDatlotObj.DalotType == DType.C) { Conc = curDatlotObj.Length / 1000 * 5.5379; Steel = (double)theData["现浇钢筋总量"]; totalSegNum = num23[0]; bzqL = 3.6; jsjL = 0; SectA = 5.5379; YiGeXiaoSanJiao = 3.6 * 3.6 * Math.Tan(30.0 / 180.0 * Math.PI) * 0.5; BZQfangshuiceng = 14.965; } else if (curDatlotObj.DalotType == DType.D) { Conc = curDatlotObj.Length / 1000 * 6.24965; Steel = (double)theData["现浇钢筋总量"]; totalSegNum = num23[0]; bzqL = 5.1; jsjL = 0; SectA = 6.24965; YiGeXiaoSanJiao = 5.1 * 5.1 * Math.Tan(30.0 / 180.0 * Math.PI) * 0.5; BZQfangshuiceng = 27.089; } string JSJConc, BZQConc; double ASteel = 0; double totalLength; string C15 = ""; string Gra = ""; string Bad = ""; if (curDatlotObj.Amont == AType.BZQ) { JSJConc = "-"; BZQConc = string.Format("{0:F1}", (double)theData["八字墙混凝土"] * 2.0); ASteel = (double)theData["八字墙钢筋"] * 2; totalLength = curDatlotObj.Length / 1000 + 2 * bzqL; C15 = string.Format("{0:F1}", (AreaOfSection[1] * totalLength + YiGeXiaoSanJiao * 4 * 0.1) * 1.05); Gra = AreaOfSection[2] == 0 ? "-" : string.Format("{0:F1}", (AreaOfSection[2] * (totalLength - curDatlotObj.MouthT / 1000 * 2) + YiGeXiaoSanJiao * 4 * curDatlotObj.LayerT / 1000) * 1.05); Bad = string.Format("{0:F1}", (AreaOfSection[3] * 2 + AreaOfSection[4]) * curDatlotObj.Length / 1000 + BZQfangshuiceng * 2.0); } else { JSJConc = string.Format("{0:F1}", (double)theData["八字墙混凝土"] * 1.0); BZQConc = string.Format("{0:F1}", (double)theData["八字墙混凝土"] * 1.0); ASteel = (double)theData["八字墙钢筋"] + (double)theData["集水井钢筋"]; totalLength = curDatlotObj.Length / 1000 + bzqL + jsjL; C15 = string.Format("{0:F1}", (AreaOfSection[1] * totalLength + YiGeXiaoSanJiao * 2 * 0.1) * 1.05); Gra = AreaOfSection[2] == 0 ? "-" : string.Format("{0:F1}", (AreaOfSection[2] * (totalLength - curDatlotObj.MouthT / 1000 * 2) + YiGeXiaoSanJiao * 2 * curDatlotObj.LayerT / 1000) * 1.05); Bad = string.Format("{0:F1}", (AreaOfSection[3] * 2 + AreaOfSection[4]) * curDatlotObj.Length / 1000 + BZQfangshuiceng * 2.0 + BZQfangshuiceng + JSJfangshuiceng); } string Mot = "-"; if (curDatlotObj.H2 - curDatlotObj.H0 - (curDatlotObj.Sect[2] - curDatlotObj.Sect[3]) / 1000 <= 0.5) { Mot = string.Format("{0:F1}", AreaOfSection[4] * curDatlotObj.Length / 1000); } string Joint = string.Format("{0:F1}", (SectA + AreaOfSection[1]) * (totalSegNum + 1)); string Rem = string.Format("{0:F1}", AreaOfSection[0] * totalLength); string Enr = string.Format("{0:F1}", (bzqL / Math.Sqrt(3) * 2 + curDatlotObj.Sect[0] / 1000) * 0.625); string Deb = string.Format("{0:F1}", (AreaOfSection[0] + AreaOfSection[5] + AreaOfSection[1] + AreaOfSection[2]) * totalLength); table.Add(1, new string[] { "Béton", "C25/30", "m3", string.Format("{0:F1}", Conc) }); table.Add(2, new string[] { "Armature", "FeE400", "kg", string.Format("{0:F1}", Steel) }); table.Add(3, new string[] { "Quantité de segment", "-", "bloc", string.Format("{0:G}", totalSegNum) }); table.Add(4, new string[] { "Puit d'eau", "C25/30", "m3", JSJConc }); table.Add(5, new string[] { "Mur en aile", "C25/30", "m3", BZQConc }); table.Add(6, new string[] { "Guide roue", "C25/30", "m3", "-" }); table.Add(7, new string[] { "Armature", "FeE400", "kg", string.Format("{0:F1}", ASteel) }); table.Add(8, new string[] { "Béton", "C12/15", "m3", C15 }); table.Add(9, new string[] { "Substitution Radier", "-", "m3", Gra }); table.Add(10, new string[] { "Badigeonnage des parements", "-", "m2", Bad }); table.Add(11, new string[] { "Motier hydro", "-", "m2", Mot }); table.Add(12, new string[] { "Joint", "-", "m2", Joint }); table.Add(13, new string[] { "Déblai", "-", "m3", Deb }); table.Add(14, new string[] { "Remblaiement au dos de dalot", "-", "m3", Rem }); table.Add(15, new string[] { "Enrochement", "-", "m3", Enr }); Dictionary <int, string> columnName = new Dictionary <int, string>(); columnName.Add(2, "Crops"); columnName.Add(5, "Entrée et sortie"); columnName.Add(8, "Foundation"); columnName.Add(11, "Etanchéité"); columnName.Add(14, "Terrassement"); // 输出表格数据 worksheet.Cells[LineIdx, 1] = " "; worksheet.Cells[LineIdx, 2] = curDatlotObj.Pk_string(); worksheet.Cells[LineIdx, 3] = "dalot"; if (curDatlotObj.DalotType == DType.A) { worksheet.Cells[LineIdx, 4] = "1-1.5*1.0"; } else if (curDatlotObj.DalotType == DType.B) { worksheet.Cells[LineIdx, 4] = "1-2.0*1.5"; } else if (curDatlotObj.DalotType == DType.C) { worksheet.Cells[LineIdx, 4] = "1-4.0*2.0"; } else if (curDatlotObj.DalotType == DType.D) { worksheet.Cells[LineIdx, 4] = "1-4.0*3.0"; } worksheet.Cells[LineIdx, 5] = 90 - curDatlotObj.Ang; worksheet.Cells[LineIdx, 6] = curDatlotObj.Length / 1000; if (curDatlotObj.Amont == AType.BZQ) { worksheet.Cells[LineIdx, 7] = "Mur en aile"; } else { worksheet.Cells[LineIdx, 7] = "Puit d'eau"; } worksheet.Cells[LineIdx, 8] = "Mur en aile"; worksheet.Cells[LineIdx, 9] = string.Format("{0:F1}", Conc); worksheet.Cells[LineIdx, 10] = string.Format("{0:F1}", Steel); worksheet.Cells[LineIdx, 11] = string.Format("{0:G}", totalSegNum); worksheet.Cells[LineIdx, 12] = JSJConc; worksheet.Cells[LineIdx, 13] = BZQConc; worksheet.Cells[LineIdx, 14] = "-"; worksheet.Cells[LineIdx, 15] = string.Format("{0:F1}", ASteel); worksheet.Cells[LineIdx, 16] = C15; worksheet.Cells[LineIdx, 17] = Gra; worksheet.Cells[LineIdx, 18] = Bad; worksheet.Cells[LineIdx, 19] = Mot; worksheet.Cells[LineIdx, 20] = Joint; worksheet.Cells[LineIdx, 21] = Deb; worksheet.Cells[LineIdx, 22] = Rem; worksheet.Cells[LineIdx, 23] = Enr; worksheet.Cells[LineIdx, 24] = curDatlotObj.H0.ToString(); for (int i = 0; i < 16; i++) { y0 = y_anchor - i * 6; if (new List <int> { 1, 4, 8, 10, 13 }.Contains(i)) { Line hengxian = new Line(PaperOrigenPoint.Convert3D(x0, y0, 0), PaperOrigenPoint.Convert3D(x1, y0, 0)); hengxian.Layer = "标注"; recorder.AppendEntity(hengxian); tr.AddNewlyCreatedDBObject(hengxian, true); } else { Line hengxian = new Line(PaperOrigenPoint.Convert3D(t1, y0, 0), PaperOrigenPoint.Convert3D(x1, y0, 0)); hengxian.Layer = "标注"; recorder.AppendEntity(hengxian); tr.AddNewlyCreatedDBObject(hengxian, true); } // 列名 if (new List <int> { 2, 5, 8, 11, 14 }.Contains(i)) { DBText txt = new DBText(); txt.TextString = columnName[i]; txt.TextStyleId = st["En"]; txt.Height = 2.5; if (i == 5 || i == 8) { txt.Position = PaperOrigenPoint.Convert3D((x0 + t1) * 0.5, y0); txt.HorizontalMode = TextHorizontalMode.TextCenter; txt.VerticalMode = TextVerticalMode.TextVerticalMid; txt.AlignmentPoint = PaperOrigenPoint.Convert3D((x0 + t1) * 0.5, y0 - 6); } else { txt.Position = PaperOrigenPoint.Convert3D((x0 + t1) * 0.5, y0); txt.HorizontalMode = TextHorizontalMode.TextCenter; txt.VerticalMode = TextVerticalMode.TextVerticalMid; txt.AlignmentPoint = PaperOrigenPoint.Convert3D((x0 + t1) * 0.5, y0 - 3); } txt.Layer = "标注"; txt.WidthFactor = 0.85; recorder.AppendEntity(txt); tr.AddNewlyCreatedDBObject(txt, true); } // 内容 if (i != 0) { for (int j = 0; j < 4; j++) { double tx = 0; if (j == 0) { tx = (t1 + t2) * 0.5; } else if (j == 1) { tx = (t3 + t2) * 0.5; } else if (j == 2) { tx = (t3 + t4) * 0.5; } else { tx = (x1 + t4) * 0.5; } DBText txt = new DBText() { TextString = table[i][j], TextStyleId = st["En"], Height = 2.5, Position = PaperOrigenPoint.Convert3D(tx, y0 - 3), HorizontalMode = TextHorizontalMode.TextCenter, VerticalMode = TextVerticalMode.TextVerticalMid, AlignmentPoint = PaperOrigenPoint.Convert3D(tx, y0 - 3), Layer = "标注", WidthFactor = 0.85, }; recorder.AppendEntity(txt); tr.AddNewlyCreatedDBObject(txt, true); } } } foreach (double x_shuxian in new List <double> { t1, t2, t3, t4 }) { Line ShuXin = new Line(); if (x_shuxian == t1) { ShuXin = new Line(PaperOrigenPoint.Convert3D(x_shuxian, y_anchor - 6), PaperOrigenPoint.Convert3D(x_shuxian, y_anchor - 96)); } else { ShuXin = new Line(PaperOrigenPoint.Convert3D(x_shuxian, y_anchor), PaperOrigenPoint.Convert3D(x_shuxian, y_anchor - 96)); } ShuXin.Layer = "标注"; recorder.AppendEntity(ShuXin); tr.AddNewlyCreatedDBObject(ShuXin, true); } DBText rowName = new DBText() { TextString = "Aspect d'ouvrage", TextStyleId = st["En"], Height = 2.5, Position = PaperOrigenPoint.Convert3D((x0 + t2) * 0.5, y_anchor - 3), HorizontalMode = TextHorizontalMode.TextCenter, VerticalMode = TextVerticalMode.TextVerticalMid, AlignmentPoint = PaperOrigenPoint.Convert3D((x0 + t2) * 0.5, y_anchor - 3), Layer = "标注", WidthFactor = 0.85, }; recorder.AppendEntity(rowName); tr.AddNewlyCreatedDBObject(rowName, true); rowName = new DBText() { TextString = "Matériaux", TextStyleId = st["En"], Height = 2.5, Position = PaperOrigenPoint.Convert3D((t2 + t3) * 0.5, y_anchor - 3), HorizontalMode = TextHorizontalMode.TextCenter, VerticalMode = TextVerticalMode.TextVerticalMid, AlignmentPoint = PaperOrigenPoint.Convert3D((t3 + t2) * 0.5, y_anchor - 3), Layer = "标注", WidthFactor = 0.85, }; recorder.AppendEntity(rowName); tr.AddNewlyCreatedDBObject(rowName, true); rowName = new DBText() { TextString = "Unité", TextStyleId = st["En"], Height = 2.5, Position = PaperOrigenPoint.Convert3D((t4 + t3) * 0.5, y_anchor - 3), HorizontalMode = TextHorizontalMode.TextCenter, VerticalMode = TextVerticalMode.TextVerticalMid, AlignmentPoint = PaperOrigenPoint.Convert3D((t3 + t4) * 0.5, y_anchor - 3), Layer = "标注", WidthFactor = 0.85, }; recorder.AppendEntity(rowName); tr.AddNewlyCreatedDBObject(rowName, true); rowName = new DBText() { TextString = "Quantité", TextStyleId = st["En"], Height = 2.5, Position = PaperOrigenPoint.Convert3D((x1 + t4) * 0.5, y_anchor - 3), HorizontalMode = TextHorizontalMode.TextCenter, VerticalMode = TextVerticalMode.TextVerticalMid, AlignmentPoint = PaperOrigenPoint.Convert3D((x1 + t4) * 0.5, y_anchor - 3), Layer = "标注", WidthFactor = 0.85, }; recorder.AppendEntity(rowName); tr.AddNewlyCreatedDBObject(rowName, true); Polyline box = new Polyline(); box.AddVertexAt(0, PaperOrigenPoint.Convert2D(x0, y0 + 15 * 6), 0, 0.3, 0.3); box.AddVertexAt(1, PaperOrigenPoint.Convert2D(x1, y0 + 15 * 6), 0, 0.3, 0.3); box.AddVertexAt(2, PaperOrigenPoint.Convert2D(x1, y0 - 6), 0, 0.3, 0.3); box.AddVertexAt(3, PaperOrigenPoint.Convert2D(x0, y0 - 6), 0, 0.3, 0.3); box.Layer = "标注"; box.Closed = true; recorder.AppendEntity(box); tr.AddNewlyCreatedDBObject(box, true); tr.Commit(); } return; }