几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】how to detect if zoom to extents is required (http://www.dimcax.com/hust/showthread.php?t=16644)

yang686526 2009-05-06 02:28 PM

【转帖】how to detect if zoom to extents is required
 
how to detect if zoom to extents is required
how to detect if zoom to extents is required
our application renders drawings to bitmap files. we have discovered that for certain dwg files, when rendering the model space layout to a bitmap that the image is cropped, not showing all elements of the image. this is resolved by first executing zoomextents on the layout before rendering.
this same behavior can be observed by opening the attached file in odamfcapp, setting the active layout to the model space layout and then vectorizing the drawing. initially, the image will be cropped. after executing zoom extents, the full image can be seen.
zoomextents takes extra time and is not necessary for all drawings, so i would like to not execute it if it is not required. is there anyway to determine if the call to zoomextents is required? in other words, is there some way to determine that not all elements in the drawing will be visible when rendered to a bitmap, unless zoomextents is executed? if this is possible, please provide complete instructions on how to accomplish this.
thanks.
attached files
collecting correct extents and verifying if all the entities are visible wil take the same amount of time.
vladimir


所有的时间均为北京时间。 现在的时间是 04:00 PM.