找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 122|回复: 0

ARX实现ZOOM功能

[复制链接]

1

主题

0

回帖

37

积分

管理员

积分
37
发表于 2024-5-2 22:37:17 | 显示全部楼层 |阅读模式
  1. // This is command 'ZOOMEXT, by Fenton Webb [Apr/17/2002], DevTech, Autodesk
  2. void asdkzoomExt()
  3. {
  4. // get the extents of the drawing
  5. AcDbViewTableRecord view;
  6. AcGePoint3d max =
  7. acdbHostApplicationServices()->workingDatabase()->extmax(),
  8.        min = acdbHostApplicationServices()->workingDatabase()->extmin();
  9. AcGePoint2d max采用2d (max[X], max[Y]);
  10. AcGePoint2d min采用2d (min[X], min[Y]);
  11. // now set the view centre point
  12. view.setCenterPoint (min采用2d + (max采用2d - min采用2d) / 2.0);
  13. // now height and width of view
  14. view.setHeight(max采用2d[Y] - min采用2d[Y]);
  15. view.setWidth (max采用2d[X] - min采用2d[X]);
  16. // set the view
  17. acedSetCurrentView (&view, NULL);
  18. // updates the extents
  19. acdbHostApplicationServices()->workingDatabase()->updateExt(TRUE);
  20. }
  21. ////////////////////////////////////////////////////////////////////////////
  22. //
  23. // This is command 'ZOOMWIN, by Fenton Webb [Apr/17/2002], DevTech, Autodesk
  24. void asdkzoomWin()
  25. {
  26. AcGePoint3d max, min;
  27. // get the window coords
  28. int res = acedGetPoint (NULL, "/nPick zoom window pnt : ",
  29. asDblArray(min));
  30. // if ok
  31. if (res == RTNORM)
  32. {
  33.   res = acedGetCorner (asDblArray(min), "/nPick other corner : ",
  34. asDblArray(max));
  35.   // get the extents of the drawing
  36.   AcDbViewTableRecord view;
  37.   AcGePoint2d max采用2d (max[X], max[Y]);
  38.   AcGePoint2d min采用2d (min[X], min[Y]);
  39.   // now set the view centre point
  40.   view.setCenterPoint (min采用2d + (max采用2d - min采用2d) / 2.0);
  41.   // now height and width of view
  42.   view.setHeight(max采用2d[Y] - min采用2d[Y]);
  43.   view.setWidth (max采用2d[X] - min采用2d[X]);
  44.   // set the view
  45.   acedSetCurrentView (&view, NULL);
  46.   // updates the extents
  47.   acdbHostApplicationServices()->workingDatabase()->updateExt(TRUE);
  48. }
  49. }
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|膜结构网

GMT+8, 2025-1-4 13:18 , Processed in 0.130813 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表