Example #1
0
        private void button__XYZExport_Click(object sender, EventArgs e)
        {
            try
            {
                ParserXYZ parser = new ParserXYZ();

                OutputLogWrite("Started parsing distances to XYZ");

                List <string> string_lenghts = new List <string>();
                StreamReader  sr             = new StreamReader(textBox__XYZFromFile.Text);
                string        line;
                while ((line = sr.ReadLine()) != null) /*Console.WriteLine(line);*/ string_lenghts {
                        = line.Split(',', ' ', '\n').ToList();
                }
Example #2
0
        private void button__XYZExport_Click(object sender, EventArgs e)
        {
            try
            {
                ParserXYZ parser = new ParserXYZ();

                OutputLogWrite("Started parsing distances to XYZ");

                List <string> string_lenghts = new List <string>();
                StreamReader  sr             = new StreamReader(textBox__XYZFromFile.Text);
                string        line;
                while ((line = sr.ReadLine()) != null)
                {
                    Console.WriteLine(line); string_lenghts = line.Split(',', ' ', '\n').ToList();
                }
                sr.Close();

                List <int> int_lengths = new List <int>();
                foreach (var str in string_lenghts)
                {
                    try
                    {
                        Console.WriteLine(str);
                        int_lengths.Add(Int32.Parse(str));
                    }
                    catch (Exception exc)
                    {
                        OutputLogWrite(exc.ToString());
                    }
                }

                OutputLogWrite("Float list done");

                List <System.Numerics.Vector3> vec3list = parser.ParseDataFromAboveScan(int_lengths, 682, 5.0f);

                Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US");

                StreamWriter sw = new StreamWriter(textBox__XYZToFile.Text, false);
                foreach (var vec3 in vec3list)
                {
                    sw.WriteLine(vec3.X + " " + vec3.Y + " " + vec3.Z);
                }
                sw.Close();
            }
            catch (Exception exc)
            {
                OutputLogWrite(exc.ToString());
            }
        }