Exemplo n.º 1
0
        private void Vornehmen_Click(object sender, EventArgs e)
        {
            try
            {
                if (!String.IsNullOrEmpty(werkzeug_neu) && height_neu != 0 && width_neu != 0 && depth_neu != 0 && werkzeug_neu.Length > 4)
                {
                    newPt = new netDxf.Entities.Point(height_neu, width_neu, depth_neu);
                    List <netDxf.Entities.Point> neuList = Doc.Points.ToList();
                    workpiece neuWorkpiece = new workpiece();
                    neuWorkpiece.depth        = depth_neu;
                    neuWorkpiece.height       = height_neu;
                    neuWorkpiece.width        = width_neu;
                    neuWorkpiece.werkzeugName = werkzeug_neu;
                    foreach (netDxf.Entities.Point item in neuList)
                    {
                        Doc.RemoveEntity(item);
                    }



                    DXF_Management.DXF_Writer.JoinToDxF(PFAD, ref Doc, neuWorkpiece);
                    MessageBox.Show("Erfolgreich vorgenommen!", "Arbeitseigenschaften Veränderung", MessageBoxButtons.OK, MessageBoxIcon.None);
                }
                else
                {
                    MessageBox.Show("Falsche Eingabe \n Bitte überprüfen Sie Ihre Eingaben!", "Arbeitseigenschaften Veränderung", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message, "Arbeitseigenschaften Veränderung", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Exemplo n.º 2
0
        private void Update(bool Pfad_leer)
        {
            if (zaehler >= 3)
            {
                label2.Visible = false;
            }
            if (!Pfad_leer)
            {
                polyline_listBox.Items.Clear();
                punkte_listBox.Items.Clear();
                allPolylines.Clear();
                netDxf.Entities.Point newPt;
                if (loadedDXF.Points.Count > 0)
                {
                    newPt = loadedDXF.Points.Last();
                }
                else
                {
                    newPt = new netDxf.Entities.Point(new Vector2(0, 0));
                }


                Height_lbl.Text = "Height : " + newPt.Location.X;
                width_lbl.Text  = "Width : " + newPt.Location.Y;
                depth_lbl.Text  = "Depth : " + newPt.Location.Z;
                try
                {
                    werkzeug_lbl.Text = "Werkzeug : " + loadedDXF.LwPolylines.Last().Layer.Name;
                }
                catch
                { }
                for (int i = 0; i < loadedDXF.LwPolylines.Count; i++)
                {
                    allPolylines.Add(i, loadedDXF.LwPolylines[i]);
                    int t = i + 1;
                    polyline_listBox.Items.Add("Polyline " + t);
                }
            }
            else
            {
                polyline_listBox.Items.Clear();
                punkte_listBox.Items.Clear();
                Height_lbl.Text   = "Height : ";
                width_lbl.Text    = "Width : ";
                depth_lbl.Text    = "Depth : ";
                werkzeug_lbl.Text = "Werkzeug : ";
            }
            zaehler += 1;
        }