工具箱相关
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.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using GrxCAD.DatabaseServices;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11. namespace HCTools
  12. {
  13. public partial class EleRd : Form
  14. {
  15. public EleRd()
  16. {
  17. InitializeComponent();
  18. }
  19. private void EleRd_Load(object sender, EventArgs e)
  20. {
  21. this.comboBox_jqx.DropDownStyle = ComboBoxStyle.DropDownList;
  22. this.comboBox_sqx.DropDownStyle = ComboBoxStyle.DropDownList;
  23. //自动填充下拉框
  24. Database database = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase;
  25. using (Transaction traction = database.TransactionManager.StartTransaction())
  26. {
  27. //存放所有图层名
  28. List<string> alllayername = new List<string>();
  29. LayerTable layertable = traction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable;
  30. foreach (ObjectId objid in layertable)
  31. {
  32. LayerTableRecord layertablerecord = traction.GetObject(objid, OpenMode.ForRead) as LayerTableRecord;
  33. alllayername.Add(layertablerecord.Name);
  34. }
  35. alllayername.Sort();
  36. for (int i = 0; i < alllayername.Count; i++)
  37. {
  38. this.comboBox_jqx.Items.Add(alllayername[i]);
  39. this.comboBox_sqx.Items.Add(alllayername[i]);
  40. }
  41. if (alllayername.Contains("8110"))
  42. {
  43. int index = alllayername.IndexOf("8110");
  44. this.comboBox_sqx.SelectedIndex = index;
  45. }
  46. if (alllayername.Contains("8120"))
  47. {
  48. int index = alllayername.IndexOf("8120");
  49. this.comboBox_jqx.SelectedIndex = index;
  50. }
  51. traction.Commit();
  52. }
  53. }
  54. private void btn_OK_Click(object sender, EventArgs e)
  55. {
  56. if (comboBox_sqx.Text == "")
  57. {
  58. GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择首曲线");
  59. return;
  60. }
  61. if (comboBox_sqx.Text == "")
  62. {
  63. GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择计曲线");
  64. return;
  65. }
  66. EleRound.jqx = comboBox_jqx.Text;
  67. EleRound.sqx = comboBox_sqx.Text;
  68. this.Close();
  69. EleRound elerd = new EleRound();
  70. elerd.eleround();
  71. }
  72. private void btn_Cancel_Click(object sender, EventArgs e)
  73. {
  74. this.Close();
  75. }
  76. }
  77. }