天气与日历 切换到窄版

 找回密码
 立即注册
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 27|回复: 0

ARX实现ZOOM功能

[复制链接]
  • TA的每日心情
    开心
    昨天 11:26
  • 签到天数: 86 天

    [LV.6]常住居民II

    1640

    主题

    207

    回帖

    214748万

    积分

    管理员

    积分
    2147483647
    发表于 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. }
    复制代码

     

     

     

     

    ARX实现ZOOM功能
    中国膜结构网打造全中国最好的膜结构综合平台 ,统一协调膜结构设计,膜结构施工,膜材采购,膜材定制,膜结构预算全方位服务。 中国空间膜结构协会合作单位。
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|手机版|中国膜结构网_中国空间膜结构协会

    GMT+8, 2024-6-2 21:55 , Processed in 0.058080 second(s), 22 queries .

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

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