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

yang686526 2009-05-05 10:39 AM

【转帖】extents problem
 
extents problem
extents problem
i'm replacing 1.12.04 with 1.13.00 i my application and have run into a small problem.
when i retrieve the extents of the drawing, there is a huge difference between the old and new values. i'd like the value in millimeters, but the new value sure isn't...
the old code looks like:
oddbextents ext;
ext.addblockext(oddbblocktablerecordptr(m_pdwgcont ext->database()->getactivelayoutbtrid().safeopenobject()));
if(ext.isvalidextents())
{
rc.m_left = ext.minpoint().x;
rc.m_bottom = ext.minpoint().y;
rc.m_right = ext.maxpoint().x;
rc.m_top = ext.maxpoint().y;
}
and the new:
oddbblocktablerecordptr playoutblock = m_pdb->getmodelspaceid().safeopenobject();
oddblayoutptr playout = playoutblock->getlayoutid().safeopenobject();
odgeextents3d ext;
();
if (playout->getblocktablerecordid().safeopenobject()->getgeomextents(ext) == eok)
{
rc.m_left = ext.minpoint().x;
rc.m_bottom = ext.minpoint().y;
rc.m_right = ext.maxpoint().x;
rc.m_top = ext.maxpoint().y;
}
the "right" value now is 95724 (was 10500) and the "top" value is 121332 (was 7425), using the same sample drawing. the "left" and "bottom" remains the same (0).
also, i have problems reading the dwgdirect.chm, the index and table of contents is there but no page will show. i have only tried opening it on my computer, so it might be a local problem. but if the solution of my question is hidden in the help file, i haven't been able to search there.
thanks in advance
håkan
"old" code gets extents of active layout and "new" one - extents of model space.
does the drawing has model space active? if so, could you post a sample file?
sergey slezkin
i get exactly the same extents values using getmodelspaceid() or getactivelayoutbtrid() in the new code. but not the same as in the old version (which are the correct ones...).
as my sample drawing is a property of a customer, i don't want to post it here. is it possible to email it to you?
am i the only one having problems reading the help file? i have been able to retrieve the html pages now, by extracting them from the chm file, but the internal link within the chm don't work for me.
thanks
håkan
you can e-mail it to me: sslezkin_at_softdev_dot_spb_dot_ru
try to download the help file again. probably it was truncated during download.
sergey slezkin


所有的时间均为北京时间。 现在的时间是 09:21 AM.