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

yang686526 2009-05-07 03:34 PM

【转帖】selecting Inserts By Name
 
selecting inserts by name
selecting inserts by name
using the latest version of the libraries (and version 2.2), this code works fine
odstring inserttype("insert");
odresbufptr rb = odresbuf::newrb(0, inserttype);
oddbselectionsetptr psset = oddbselectionset::select(pdb, rb);
odstring s;
int count = psset->numentities();
s.format(dd_t("%d block inserts"), count);
but this code fails with an exception:
odstring inserttype("insert");
odstring blockname ("hydrant");
odresbufptr rb = odresbuf::newrb(0, inserttype);
rb->setnext(odresbuf::newrb(2, blockname));
oddbselectionsetptr psset = oddbselectionset::select(pdb, rb);
odstring s;
int count = psset->numentities();
s.format(dd_t("%d block inserts with name hydrant"), count);
is there a way i can select by block name?
thanks.
most probably the exception's description (oderror::description()) says that odbagfiler drx is missing.
if this module presents than the code you provided works.
sergey slezkin


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