马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
////////////////////////////////////////////////////////////////////////////
//
// 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);
}
}
|