|
- // 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[X], max[Y]);
- AcGePoint2d min采用2d (min[X], min[Y]);
- // 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[Y] - min采用2d[Y]);
- view.setWidth (max采用2d[X] - min采用2d[X]);
- // 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[X], max[Y]);
- AcGePoint2d min采用2d (min[X], min[Y]);
- // 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[Y] - min采用2d[Y]);
- view.setWidth (max采用2d[X] - min采用2d[X]);
- // set the view
- acedSetCurrentView (&view, NULL);
- // updates the extents
- acdbHostApplicationServices()->workingDatabase()->updateExt(TRUE);
- }
- }
复制代码 |
|