public void TextAdd() { PlanMapService planMapService = new PlanMapService(); Utils utils = new Utils(); IList <DBText> list = CADUtils.SeletTexts(); if (list != null && list.Count > 1) { using (Transaction transaction = utils.GetDabase().TransactionManager.StartTransaction()) { DBText dBText = transaction.GetObject(list[0].ObjectId, OpenMode.ForWrite) as DBText; string text = dBText.TextString; for (int i = 1; i < list.Count; i++) { text = text + "、" + list[i].TextString; } if (dBText.Height == 1.0) { dBText.Height = (0.8); dBText.WidthFactor = (0.8); } text = text.Replace("(户)、", "、"); dBText.TextString = (text); transaction.Commit(); } } }
public string CheckPlans() { try { PlanMapService planMapService = new PlanMapService(); List <Nf> nfs = planMapService.CheckPlanArea(); planMapService.createNfZmj(nfs); } finally { this.deleteLayerSur("删除"); } return(""); }
/// <summary> /// 宗地图整饰1 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button18_Click(object sender, EventArgs e) { Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument; DocumentLock documentLock = mdiActiveDocument.LockDocument(); try { PlanMapService planMapService = new PlanMapService(); planMapService.RegulatePlanMap(); } finally { documentLock.Dispose(); } }
/// <summary> /// 宗地图文字样式整理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button28_Click(object sender, EventArgs e) { Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument; DocumentLock documentLock = mdiActiveDocument.LockDocument(); try { PlanMapService planMapService = new PlanMapService(); planMapService.ZDTTextManger(); } finally { UserControl1.main.deleteLayerSur("删除"); documentLock.Dispose(); } }
/// <summary> /// 导出任意图幅 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button29_Click(object sender, EventArgs e) { Document mdiActiveDocument = Application.DocumentManager.MdiActiveDocument; DocumentLock documentLock = mdiActiveDocument.LockDocument(); string path = Utils.CADDir(); //string text = FileUtils.SeleFileDir("权籍调查表保存位置", Path.GetDirectoryName(path)); try { PlanMapService planMapService = new PlanMapService(); planMapService.ExportRenYiTuFuKuang(Path.GetDirectoryName(path)); } finally { UserControl1.main.deleteLayerSur("删除"); documentLock.Dispose(); } }
internal static IList <Point3dCollection> GetRecPcs(string tips) { PlanMapService ps = new PlanMapService(); IList <Point3dCollection> list = new List <Point3dCollection>(); DBText dbText = ps.SelectText(tips); Point3d startPt = ps.PickupPoint("拾取存图左上角的一点"); Point3d endPt = ps.PickupPoint("拾取存图右下角的一点"); //得到矩形框 Point3dCollection recPc = GetRecPc(startPt, endPt); Point3dCollection pcDi = ps.GetDistanceReduce(dbText.Position, recPc); Point3dCollection titlePoints = utils.findEntityPoints(dbText.TextString); foreach (Point3d pt in titlePoints) { Point3dCollection onePc = ps.GetDistanceReduce(pt, pcDi); list.Add(onePc); } return(list); }
private void button1_Click(object sender, EventArgs e) { PlanMapService planMapService = new PlanMapService(); String berforStr = GetTextBoxString(textBox1); String afterStr = GetTextBoxString(textBox2); String dir = GetTextBoxString(textBox3); if (dir.Equals("")) { MessageBox.Show("你想干什么,文件夹名字没有选择"); } else if (!Directory.Exists(dir)) { MessageBox.Show("你想干什么,文件夹都不在,还想保存"); } else { this.Close(); this.Visible = false; planMapService.SplitDrawingForm(berforStr, afterStr, dir); } }