nym 发表于 2005-11-30 14:07:00

视口缩放

<P>&nbsp;&nbsp;acedCommand(RTSTR, "Zoom", RTSTR, "Window", RTPOINT, dZoomMin,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RTPOINT, dZoomMax, RTNONE);</P>
<P>上面是我用command命令实现的视口缩放的功能,</P>
<P>请问如果不用command命令,该怎么做呢?</P>
<P>寻求帮助,谢谢!!!</P>

王咣生 发表于 2005-11-30 20:36:00

reply

<P>应该发在arx版块:</P>
<P>void zoomWindow(AcGePoint3d &amp;min, AcGePoint3d &amp;max)<BR>{<BR>&nbsp;// get the extents of the drawing<BR>&nbsp;AcDbViewTableRecord view;</P>
<P>&nbsp;AcGePoint2d max_2d (max, max);<BR>&nbsp;AcGePoint2d min_2d (min, min);<BR>&nbsp;// now set the view center point<BR>&nbsp;view.setCenterPoint(min_2d + (max_2d - min_2d) / 2.0);<BR>&nbsp;// now height and width of view<BR>&nbsp;view.setHeight(max_2d - min_2d);<BR>&nbsp;view.setWidth(max_2d - min_2d);<BR>&nbsp;// set the view<BR>&nbsp;acedSetCurrentView(&amp;view, NULL);<BR>&nbsp;// update the extents<BR>&nbsp;acdbHostApplicationServices()-&gt;workingDatabase()-&gt;updateExt(TRUE);<BR>}</P>
页: [1]
查看完整版本: 视口缩放