Beispiel #1
0
        static public void ZoomWindow()
        {
            _AcAp.Document doc =

                _AcAp.Application.DocumentManager.MdiActiveDocument;

            _AcDb.Database db = doc.Database;

            _AcEd.Editor ed = doc.Editor;


            // Get the window coordinates


            _AcEd.PromptPointOptions ppo =

                new _AcEd.PromptPointOptions(

                    "\nSpecify first corner:"

                    );


            _AcEd.PromptPointResult ppr =

                ed.GetPoint(ppo);


            if (ppr.Status != _AcEd.PromptStatus.OK)
            {
                return;
            }


            _AcGe.Point3d min = ppr.Value;


            _AcEd.PromptCornerOptions pco =

                new _AcEd.PromptCornerOptions(

                    "\nSpecify opposite corner: ",

                    ppr.Value

                    );


            ppr = ed.GetCorner(pco);


            if (ppr.Status != _AcEd.PromptStatus.OK)
            {
                return;
            }


            _AcGe.Point3d max = ppr.Value;


            // Call out helper function

            // [Change this to ZoomWin2 or WoomWin3 to

            // use different zoom techniques]


            //ZoomWin(ed, min, max);
            Plan2Ext.Globs.Zoom(new _AcGe.Point3d(min.X, min.Y, 0.0), new _AcGe.Point3d(max.X, max.Y, 0), new _AcGe.Point3d(), 1.0);
        }