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

yang686526 2009-05-04 07:23 PM

【转帖】determining extents when creating entities
 
determining extents when creating entities
determining extents when creating entities
in the previous version, which i downloaded february 9, 2005, i was able to add extents for an entity using addblockext(). in 1.13, this method apparently does not exist. what is the recommended approach for determinig the extents of an individual entity? for the entire drawing?
my previous code is:
code:
oddbblocktablerecordptr pblock = blockid_.saveopenobject (oddb::kforwrite);
oddbcircleptr pcircle = oddbcircle::createobject();
pblock->appendoddbentity(pcircle);
pcircle->setcenter(centerf);
pcircle->setradius(radiusf);
extents_.addblockext (pblock);
thanks for any help.
both oddbentity and oddbblocktablerecord have getgeomextents() method. oddbblocktablerecord::getgeomextents() iterates through entities so it's better to call it once after all entities are appended.
if you want to perform zoom extents getgeomextents() is not the best way. some entities may have viewport-dependent geometry, in a viewport some entities may be invisible because their layer is frozen etc.
oddbviewport, oddbviewporttablerecord, oddbviewtablerecord and odgsview have odabstractviewpe protocol extension which has methods viewextents(), zoomextents()
to perform zoom extents in paper viewport (oddbviewport) or model viewport (oddbviewporttablerecord) its better to use odabstractviewpe::zoomextents().
sergey slezkin


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