using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using GrxCAD.EditorInput; using GrxCAD.DatabaseServices; using GrxCAD.Geometry; namespace HCTools { public partial class PLError_Overlay : Form { public PLError_Overlay() { InitializeComponent(); } private void PLError_Load(object sender, EventArgs e) { if (MainClass.Flag == "PLError" ) { this.Text = "点线矛盾"; } if (MainClass.Flag == "PLOverlap") { this.Text = "点线重叠"; } this.comboBox_ElePoint.DropDownStyle = ComboBoxStyle.DropDownList; this.comboBox_blc.DropDownStyle = ComboBoxStyle.DropDownList; this.comboBox_sqx.DropDownStyle = ComboBoxStyle.DropDownList; this.comboBox_jqx.DropDownStyle = ComboBoxStyle.DropDownList; //this.MaximizeBox = false; //this.StartPosition = FormStartPosition.CenterScreen; //参数清零 //CheckPLOverlay.EleLayerName = null; //CheckPLOverlay.sqx = null; //CheckPLOverlay.jqx = null; //CheckPLOverlay.blc = 0; //自动填充下拉框 Database database = GrxCAD.DatabaseServices.HostApplicationServices.WorkingDatabase; using (Transaction traction = database.TransactionManager.StartTransaction()) { //存放所有图层名 List alllayername = new List(); LayerTable layertable = traction.GetObject(database.LayerTableId, OpenMode.ForRead) as LayerTable; foreach (ObjectId objid in layertable) { LayerTableRecord layertablerecord = traction.GetObject(objid, OpenMode.ForRead) as LayerTableRecord; alllayername.Add(layertablerecord.Name); } alllayername.Sort(); for (int i = 0; i < alllayername.Count; i++) { this.comboBox_ElePoint.Items.Add(alllayername[i]); this.comboBox_sqx.Items.Add(alllayername[i]); this.comboBox_jqx.Items.Add(alllayername[i]); } if (alllayername.Contains("8300")) { int index = alllayername.IndexOf("8300"); this.comboBox_ElePoint.SelectedIndex = index; } if (alllayername.Contains("8110")) { int index = alllayername.IndexOf("8110"); this.comboBox_sqx.SelectedIndex = index; } if (alllayername.Contains("8120")) { int index = alllayername.IndexOf("8120"); this.comboBox_jqx.SelectedIndex = index; } traction.Commit(); } } private void btn_OK_Click(object sender, EventArgs e) { if (MainClass.Flag == "PLOverlap") { if (comboBox_ElePoint.Text == "") { GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择高程点图层"); return; } if (comboBox_blc.Text == "") { GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择比例尺"); return; } if (comboBox_sqx.Text == "") { GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择首曲线图层"); return; } if (comboBox_jqx.Text == "") { GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择计曲线图层"); return; } CheckPLOverlay.EleLayerName = comboBox_ElePoint.Text; CheckPLOverlay.sqx = comboBox_sqx.Text; CheckPLOverlay.jqx = comboBox_jqx.Text; //比例尺 string blctext = comboBox_blc.Text; int blcindex = blctext.LastIndexOf(':'); string strblc = blctext.Substring(blcindex + 1); CheckPLOverlay.blc = Convert.ToInt32(strblc); this.Close(); CheckPLOverlay plcon = new CheckPLOverlay(); plcon.contourch(); } if (MainClass.Flag == "PLError") { if (comboBox_ElePoint.Text == "") { GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择高程点图层"); return; } if (comboBox_blc.Text == "") { GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择比例尺"); return; } if (comboBox_sqx.Text == "") { GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择首曲线图层"); return; } if (comboBox_jqx.Text == "") { GrxCAD.ApplicationServices.Application.ShowAlertDialog("请选择计曲线图层"); return; } ChPLContradiction.elevationLayer = comboBox_ElePoint.Text; ChPLContradiction.sqx = comboBox_sqx.Text; ChPLContradiction.jqx = comboBox_jqx.Text; //比例尺 string blctext = comboBox_blc.Text; int blcindex = blctext.LastIndexOf(':'); string strblc = blctext.Substring(blcindex + 1); int rade = Convert.ToInt32(strblc); ChPLContradiction.blc = rade; this.Close(); ChPLContradiction chplc = new ChPLContradiction(); chplc.contourch(); } } private void btn_Cancel_Click(object sender, EventArgs e) { this.Close(); } } }