天气与日历 切换到窄版

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

acad的窗口缩放效果,类似VBA的ZoomWindow

[复制链接]

该用户从未签到

主题

0

回帖

2912

积分

管理员

积分
2912
发表于 2024-6-22 09:46:18 | 显示全部楼层 |阅读模式
acad的窗口缩放效果,类似VBA的ZoomWindow
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);
}
}

 

 

 

 

acad的窗口缩放效果,类似VBA的ZoomWindow
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|中国膜结构网|中国膜结构协会|进口膜材|国产膜材|ETFE|PVDF|PTFE|设计|施工|安装|车棚|看台|污水池|中国膜结构网_中国空间膜结构协会

GMT+8, 2024-11-1 11:38 , Processed in 0.164522 second(s), 27 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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