工具箱相关
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PLError_Overlay.cs 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using GrxCAD.EditorInput;
  11. using GrxCAD.DatabaseServices;
  12. using GrxCAD.Geometry;
  13. namespace HCTools
  14. {
  15. public partial class PLError_Overlay : Form
  16. {
  17. public PLError_Overlay()
  18. {
  19. InitializeComponent();
  20. }
  21. private void PLError_Load(object sender, EventArgs e)
  22. {
  23. if (MainClass.Flag == "PLError" )
  24. {
  25. this.Text = "点线矛盾";
  26. }
  27. if (MainClass.Flag == "PLOverlap")
  28. {
  29. this.Text = "点线重叠";
  30. }
  31. this.comboBox_ElePoint.DropDownStyle = ComboBoxStyle.DropDownList;
  32. this.comboBox_blc.DropDownStyle = ComboBoxStyle.DropDownList;
  33. this.comboBox_sqx.DropDownStyle = ComboBoxStyle.DropDownList;
  34. this.comboBox_jqx.DropDownStyle = ComboBoxStyle.DropDownList;
  35. //this.MaximizeBox = false;
  36. //this.StartPosition = FormStartPosition.CenterScreen;
  37. //参数清零
  38. //CheckPLOverlay.EleLayerName = null;
  39. //CheckPLOverlay.sqx = null;
  40. //CheckPLOverlay.jqx = null;
  41. //CheckPLOverlay.blc = 0;
  42. //自动填充下拉框
  43. Database database = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
  44. using (Transaction traction = database.TransactionManager.StartTransaction())
  45. {
  46. //存放所有图层名
  47. List<string> alllayername = new List<string>();
  48. LayerTable layertable = traction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
  49. foreach (ObjectId objid in layertable)
  50. {
  51. LayerTableRecord layertablerecord = traction.GetObject(objid, OpenMode.ForRead) as LayerTableRecord;
  52. alllayername.Add(layertablerecord.Name);
  53. }
  54. alllayername.Sort();
  55. for (int i = 0; i < alllayername.Count; i++)
  56. {
  57. this.comboBox_ElePoint.Items.Add(alllayername[i]);
  58. this.comboBox_sqx.Items.Add(alllayername[i]);
  59. this.comboBox_jqx.Items.Add(alllayername[i]);
  60. }
  61. if (alllayername.Contains("8300"))
  62. {
  63. int index = alllayername.IndexOf("8300");
  64. this.comboBox_ElePoint.SelectedIndex = index;
  65. }
  66. if (alllayername.Contains("8110"))
  67. {
  68. int index = alllayername.IndexOf("8110");
  69. this.comboBox_sqx.SelectedIndex = index;
  70. }
  71. if (alllayername.Contains("8120"))
  72. {
  73. int index = alllayername.IndexOf("8120");
  74. this.comboBox_jqx.SelectedIndex = index;
  75. }
  76. traction.Commit();
  77. }
  78. }
  79. private void btn_OK_Click(object sender, EventArgs e)
  80. {
  81. if (MainClass.Flag == "PLOverlap")
  82. {
  83. if (comboBox_ElePoint.Text == "")
  84. {
  85. GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择高程点图层");
  86. return;
  87. }
  88. if (comboBox_blc.Text == "")
  89. {
  90. GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择比例尺");
  91. return;
  92. }
  93. if (comboBox_sqx.Text == "")
  94. {
  95. GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择首曲线图层");
  96. return;
  97. }
  98. if (comboBox_jqx.Text == "")
  99. {
  100. GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择计曲线图层");
  101. return;
  102. }
  103. CheckPLOverlay.EleLayerName = comboBox_ElePoint.Text;
  104. CheckPLOverlay.sqx = comboBox_sqx.Text;
  105. CheckPLOverlay.jqx = comboBox_jqx.Text;
  106. //比例尺
  107. string blctext = comboBox_blc.Text;
  108. int blcindex = blctext.LastIndexOf(':');
  109. string strblc = blctext.Substring(blcindex + 1);
  110. CheckPLOverlay.blc = Convert.ToInt32(strblc);
  111. this.Close();
  112. CheckPLOverlay plcon = new CheckPLOverlay();
  113. plcon.contourch();
  114. }
  115. if (MainClass.Flag == "PLError")
  116. {
  117. if (comboBox_ElePoint.Text == "")
  118. {
  119. GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择高程点图层");
  120. return;
  121. }
  122. if (comboBox_blc.Text == "")
  123. {
  124. GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择比例尺");
  125. return;
  126. }
  127. if (comboBox_sqx.Text == "")
  128. {
  129. GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择首曲线图层");
  130. return;
  131. }
  132. if (comboBox_jqx.Text == "")
  133. {
  134. GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择计曲线图层");
  135. return;
  136. }
  137. ChPLContradiction.elevationLayer = comboBox_ElePoint.Text;
  138. ChPLContradiction.sqx = comboBox_sqx.Text;
  139. ChPLContradiction.jqx = comboBox_jqx.Text;
  140. //比例尺
  141. string blctext = comboBox_blc.Text;
  142. int blcindex = blctext.LastIndexOf(':');
  143. string strblc = blctext.Substring(blcindex + 1);
  144. int rade = Convert.ToInt32(strblc);
  145. ChPLContradiction.blc = rade;
  146. this.Close();
  147. ChPLContradiction chplc = new ChPLContradiction();
  148. chplc.contourch();
  149. }
  150. }
  151. private void btn_Cancel_Click(object sender, EventArgs e)
  152. {
  153. this.Close();
  154. }
  155. }
  156. }