Ejemplo n.º 1
0
        public static void LoadPoints()
        {
            try
            {
                string  txt    = Gui.InputBox("输入基站坐标");
                Point3d zero   = Interaction.GetPoint("ZeroPoint");
                double  size   = Interaction.GetValue("点(基站)大小", 1000);
                double  height = Interaction.GetValue("文字高度", 1000);
                //string key = Interaction.GetString("搜索", "");
                string   key   = "";
                string[] lines = txt.Split('\n');
                for (int i = 0; i < lines.Length; i++)
                {
                    string line = lines[i].Trim();
                    if (string.IsNullOrEmpty(line))
                    {
                        continue;
                    }
                    string[] parts = line.Split(',');
                    string   name = "";
                    double   x = 0, y = 0, z = 0;
                    if (parts.Length == 5)
                    {
                        name = parts[0];
                        x    = parts[2].ToDouble();
                        y    = parts[3].ToDouble();
                        z    = parts[4].ToDouble();
                    }
                    if (parts.Length == 4)
                    {
                        name = parts[0];
                        x    = parts[1].ToDouble();
                        y    = parts[2].ToDouble();
                        z    = parts[3].ToDouble();
                    }


                    if (string.IsNullOrEmpty(key) || name == key)
                    {
                        Point3d point = new Point3d(x + zero.X, y + zero.Y, z + zero.Z);
                        Draw.Point(point);
                        if (size > 0)
                        {
                            Draw.Circle(point, size);
                        }
                        if (height > 0)
                        {
                            Draw.Text(name, height, point);
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                MyTool.TextReport("Exception", ex.ToString(), 700, 500);
            }
        }
Ejemplo n.º 2
0
        public static void LoadPoints()
        {
            string txt    = Gui.InputBox("输入坐标");
            double size   = Interaction.GetValue("点大小", 2);
            double height = Interaction.GetValue("文字高度", 2);
            string key    = Interaction.GetString("搜索", "");

            string[] lines = txt.Split('\n');
            for (int i = 0; i < lines.Length; i++)
            {
                string line = lines[i].Trim();
                if (string.IsNullOrEmpty(line))
                {
                    continue;
                }
                string[] parts = line.Split(',');
                string   name  = parts[0];
                double   x     = parts[2].ToDouble();
                double   y     = parts[3].ToDouble();
                double   z     = parts[4].ToDouble();

                if (string.IsNullOrEmpty(key) || name == key)
                {
                    Point3d point = new Point3d(x, y, z);
                    Draw.Point(point);
                    if (size > 0)
                    {
                        Draw.Circle(point, size);
                    }
                    if (height > 0)
                    {
                        Draw.Text(name, height, point);
                    }
                }
            }
        }