![]() |
【转帖】how to get the range of the layout that last zoom to
how to get the range of the layout that last zoom to ?
how to get the range of the layout that last zoom to ? hi i open a dwg file that have many layout. in autocad,every layout have a viewport range that store the range of user last zoom to,when i change layout,autocad will zoom to the last viewport range . how can i get the viewport range of every layout ? when i change the layout,i use the code to get the viewport odgsview *pview=m_pdevice->viewat(0); odgepoint3d tag=pview->target(); double fieldwidth=pview->fieldwidth(); double fieldheight=pview->fieldheight(); i always get the same viewport. if i change the code to below oddblayoutptr playout=pdatabase->findlayoutnamed(pdatabase->findactivelayout(true)).safeopenobject(); oddbobjectid id=playout->activeviewportid(); oddbviewportptr pviewport=id.safeopenobject(); odgepoint3d tag=pviewport->viewtarget(); double fieldwidth=pviewport->width(); double fieldheight=pviewport->height(); id is null,why ? by the way. i write a cdwgvectorizedevice inherit from dgsbasevectorizedevice,odgigeometrysimplifier and odrxdispatchimpl<>, i set the background is black and when i draw a entity which color is the same as background color,i use inverse color to draw it,everything is ok. when i change the layout to paper space,there is a paper whick color is white ,when i draw a entity which color is black,so i change it's color to white,and draw a white entity to white paper,i can't see the entity again. how can i avoid it ? last edited by yashu; 12th november 2004 at 09:56 pmfff">. |
所有的时间均为北京时间。 现在的时间是 04:27 AM. |