diff --git a/OpenNest/Forms/EditNestForm.Designer.cs b/OpenNest/Forms/EditNestForm.Designer.cs index 69924e1..9cf6600 100644 --- a/OpenNest/Forms/EditNestForm.Designer.cs +++ b/OpenNest/Forms/EditNestForm.Designer.cs @@ -40,6 +40,7 @@ this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); this.btnAssignLeadIns = new System.Windows.Forms.ToolStripButton(); this.btnPlaceLeadIn = new System.Windows.Forms.ToolStripButton(); + this.btnRemoveLeadIns = new System.Windows.Forms.ToolStripButton(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.drawingListBox1 = new OpenNest.Controls.DrawingListBox(); this.toolStrip2 = new System.Windows.Forms.ToolStrip(); @@ -137,7 +138,8 @@ this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripButton1, this.btnAssignLeadIns, - this.btnPlaceLeadIn}); + this.btnPlaceLeadIn, + this.btnRemoveLeadIns}); this.toolStrip1.Location = new System.Drawing.Point(3, 3); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new System.Drawing.Size(227, 31); @@ -174,6 +176,15 @@ this.btnPlaceLeadIn.Text = "Place Lead-in"; this.btnPlaceLeadIn.Click += new System.EventHandler(this.PlaceLeadIn_Click); // + // btnRemoveLeadIns + // + this.btnRemoveLeadIns.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.btnRemoveLeadIns.ImageTransparentColor = System.Drawing.Color.Magenta; + this.btnRemoveLeadIns.Name = "btnRemoveLeadIns"; + this.btnRemoveLeadIns.Size = new System.Drawing.Size(104, 28); + this.btnRemoveLeadIns.Text = "Remove Lead-ins"; + this.btnRemoveLeadIns.Click += new System.EventHandler(this.RemoveLeadIns_Click); + // // tabPage2 // this.tabPage2.Controls.Add(this.drawingListBox1); @@ -290,5 +301,6 @@ private System.Windows.Forms.ToolStripButton toolStripButton3; private System.Windows.Forms.ToolStripButton btnAssignLeadIns; private System.Windows.Forms.ToolStripButton btnPlaceLeadIn; + private System.Windows.Forms.ToolStripButton btnRemoveLeadIns; } } \ No newline at end of file diff --git a/OpenNest/Forms/EditNestForm.cs b/OpenNest/Forms/EditNestForm.cs index 082fd1f..db3f7c2 100644 --- a/OpenNest/Forms/EditNestForm.cs +++ b/OpenNest/Forms/EditNestForm.cs @@ -738,6 +738,38 @@ namespace OpenNest.Forms PlateView.Invalidate(); } + private void RemoveLeadIns_Click(object sender, EventArgs e) + { + if (PlateView?.Plate == null) + return; + + var plate = PlateView.Plate; + var count = 0; + + foreach (var part in plate.Parts) + { + if (part.HasManualLeadIns) + { + part.RemoveLeadIns(); + count++; + } + } + + if (count == 0) + return; + + plate.CuttingParameters = null; + + // Rebuild all layout part graphics + foreach (var lp in PlateView.Parts) + { + lp.IsDirty = true; + lp.Update(); + } + + PlateView.Invalidate(); + } + private void PlaceLeadIn_Click(object sender, EventArgs e) { if (PlateView?.Plate == null)