几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】extent trouble with dwgdirect 2.2 (http://www.dimcax.com/hust/showthread.php?t=16260)

yang686526 2009-05-05 10:37 AM

【转帖】extent trouble with dwgdirect 2.2
 
extent trouble with dwgdirect 2.2
extent trouble with dwgdirect 2.2
hi guys !
i have a dwg viewer that can make extentzoom but with the new dwgdirect some drawing are really really zoomed out...
my old code with dwgdirect 1.1 was:
code:
oddbextents ext;
ext.addblockext(oddbblocktablerecordptr(pdb->getactivelayoutbtrid().safeopenobject()));
my new code with dwgdirect 2.2 is:
code:
odgeextents3d ext;
oddbblocktablerecordptr(pdb->getactivelayoutbtrid().safeopenobject())->getgeomextents(ext);
on some drawing i get :
ext.minpoint.x = -148349.32463403541 and
ext.minpoint.y = -104818.85691896164
and when i look in acad the (0,0,0) point is in the very low left corner of my drawing. so why -148349 !!?.
do you have anything else to replace the old oddbextents or any other idea ?
thx for your help
oddbblocktablerecord::getgeomextents() does not always return the same result as zoom extents operation. for example entities on layer frozen in viewport are not honored while performing zoom extents in viewport but they are included into extents returned by getgeomextents().
to perform zoom extents the better way is using
oddbviewport::zoomextents()
oddbviewporttablerecord::zoomextents()
odabstractviewpe::zoomextents()
oddbabstractviewpe is a protocol extention attached to all view-related classes.
if zoom extents operation in odamfcapp works incorrectly with your file please attach it.
sergey slezkin


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