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

yang686526 2009-05-06 08:10 PM

【转帖】oddbselectionsetptrnumentities90 for xrefs
 
oddbselectionsetptr::numentities() for xrefs..
oddbselectionsetptr::numentities() for xrefs..
hi all,
i am trying to access entity depending on the layer name.
in case of xrefs i am not able to get entities..
here is the code snippet..
oddbblocktableptr pblocks = pdb->getblocktableid().safeopenobject();
oddblayertableptr playertable = pdb->getlayertableid().safeopenobject();
oddbsymboltableiteratorptr pi = playertable->newiterator();
for (pi->start(); !pi->done(); pi->step())
{
oddblayertablerecordptr player = pi->getrecordid().safeopenobject();
odstring layername = player->getname();
odresbufptr rb = odresbuf::newrb(odresbuf::kdxflayername, layername);
oddbselectionsetptr setofentities = oddbselectionset::select(pdb,rb);
int count = setofentities->numentities();
}
in case of xref layername is something leik "xref|111", where in xref i have 111 as layer and few entities in xref..
but "count" in case of xrefs is always 0.
even i tried to set layername = 111 in filter, still count is 0.
please help me out
i am new to od so please let me know if i am doing anything wrong..
thank u..
oddbselectionset::select() works with modelspace and paperspaces only.
vladimir
so what should i use in case of xrefs??
yes i am working with model space only..
search directly in the xref database.
(it is accessible via oddbblocktablerecord::xrefdatabase())
vladimir


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