|
- ////////////////////////////////////////////////////////////////////////////
- //
- // This is command 'ZOOMEXT, by Fenton Webb [Apr/17/2002], DevTech, Autodesk
- void asdkzoomExt()
- {
- // get the extents of the drawing
- AcDbViewTableRecord view;
- AcGePoint3d max =
- acdbHostApplicationServices()->workingDatabase()->extmax(),
- min = acdbHostApplicationServices()->workingDatabase()->extmin();
- AcGePoint2d max采用2d (max, max);
- AcGePoint2d min采用2d (min, min);
- // now set the view centre point
- view.setCenterPoint (min采用2d + (max采用2d - min采用2d) / 2.0);
- // now height and width of view
- view.setHeight(max采用2d - min采用2d);
- view.setWidth (max采用2d - min采用2d);
- // set the view
- acedSetCurrentView (&view, NULL);
- // updates the extents
- acdbHostApplicationServices()->workingDatabase()->updateExt(TRUE);
- }
- ////////////////////////////////////////////////////////////////////////////
- //
- // This is command 'ZOOMWIN, by Fenton Webb [Apr/17/2002], DevTech, Autodesk
- void asdkzoomWin()
- {
- AcGePoint3d max, min;
- // get the window coords
- int res = acedGetPoint (NULL, "\nPick zoom window pnt : ",
- asDblArray(min));
- // if ok
- if (res == RTNORM)
- {
- res = acedGetCorner (asDblArray(min), "\nPick other corner : ",
- asDblArray(max));
- // get the extents of the drawing
- AcDbViewTableRecord view;
- AcGePoint2d max采用2d (max, max);
- AcGePoint2d min采用2d (min, min);
- // now set the view centre point
- view.setCenterPoint (min采用2d + (max采用2d - min采用2d) / 2.0);
- // now height and width of view
- view.setHeight(max采用2d - min采用2d);
- view.setWidth (max采用2d - min采用2d);
- // set the view
- acedSetCurrentView (&view, NULL);
- // updates the extents
- acdbHostApplicationServices()->workingDatabase()->updateExt(TRUE);
- }
- }
复制代码 |
|