Ejemplo n.º 1
0
        private void buttonCloseAllViews_Click(object sender, EventArgs e)
        {
            var views = ViewHandler.GetAllViews();

            while (views.MoveNext())
            {
                var view = views.Current;
                ViewHandler.HideView(view);
            }
        }
Ejemplo n.º 2
0
        private void buttonCloseView_Click(object sender, EventArgs e)
        {
            var viewNames    = listBoxViews.SelectedItems.OfType <string>().ToList();
            var currentViews = ViewHandler.GetAllViews();

            while (currentViews.MoveNext())
            {
                var currentView = currentViews.Current;
                if (viewNames.Contains(currentView.Name))
                {
                    ViewHandler.HideView(currentView);
                }
            }
        }
Ejemplo n.º 3
0
        public static void Main(string[] args)
        {
            ModelViewEnumerator viewEnum = ViewHandler.GetTemporaryViews();

            while (viewEnum.MoveNext())
            {
                var currentView = viewEnum.Current;
                ViewHandler.HideView(currentView);
            }

            var picker     = new Picker();
            var connection = picker.PickObject(Picker.PickObjectEnum.PICK_ONE_OBJECT) as Connection;

            if (connection == null)
            {
                return;
            }

            var origin = connection.GetCoordinateSystem().Origin;

            var minPoint = new Point
            {
                X = origin.X - 200,
                Y = origin.Y - 200,
                Z = origin.Z - 300
            };

            var maxPoint = new Point
            {
                X = origin.X + 200,
                Y = origin.Y + 200,
                Z = origin.Z + 300
            };
            var name = $"Connection: {connection.Name} ({connection.Identifier.ID})";
            var view = new View
            {
                Name = name,
                ViewCoordinateSystem =
                {
                    AxisX  = new Vector(1, 0, 0),
                    AxisY  = new Vector(0, 1, 0),
                    Origin = origin
                },
                DisplayCoordinateSystem = new CoordinateSystem()
                {
                    AxisX  = new Vector(1, -.7, 0),
                    AxisY  = new Vector(0, 1, 2),
                    Origin = origin
                },
                WorkArea =
                {
                    MinPoint = minPoint,
                    MaxPoint = maxPoint
                },
                ViewDepthUp   = 500,
                ViewDepthDown = 500,
            };

            view.Insert();

            var views = ViewHandler.GetAllViews();

            while (views.MoveNext())
            {
                var currentView = views.Current;
                if (currentView.Name == name)
                {
                    ViewHandler.ShowView(currentView);
                }
            }
        }