![]() |
【转帖】get entents of a xref
get entents of a xref
get entents of a xref i am trying to get entents of a xref. if i put the xref the same directory as the master file, i am ok. if the xref is in a network drive (e.g. \\sps200\templates\border_0.dwg), i can't use oddbblockreference::getgeomextents() to get the extents. by the way, i can see the xref is properly loaded in the file. // the blockid is the xref id //blockname is the xref name oddbblocktablerecordptr pms = blockid.safeopenobject(); oddbobjectiteratorptr pentiter; for(pentiter = pms->newiterator(); !pentiter->done(); pentiter->step()) { oddbentityptr pent = pentiter->entity(oddb::kforread); oddbblockreferenceptr pref = oddbblockreference::cast(pent); if (!pref.isnull()) { oddbblocktablerecordptr pblock = pref->blocktablerecord().safeopenobject(); strcpy(test, pblock->getname()); if (_stricmp(pblock->getname(), blockname) == 0) { scale3d = pref->scalefactors(); if ( pref->getgeomextents(ext) != eok ) continue; } } } scalefactors() returns the right scale. however, the getgeomextents doesn't return eok, is this a bug of the lib or i am doing something wrong. thanks, al i made a mistake when i posted the message. the blockid is the modelspace block id from the drawing. so my code looks like: // the blockid is the modelspace id //blockname is the xref name oddbblocktablerecordptr pms = blockid.safeopenobject(); oddbobjectiteratorptr pentiter; for(pentiter = pms->newiterator(); !pentiter->done(); pentiter->step()) { oddbentityptr pent = pentiter->entity(oddb::kforread); oddbblockreferenceptr pref = oddbblockreference::cast(pent); if (!pref.isnull()) { oddbblocktablerecordptr pblock = pref->blocktablerecord().safeopenobject(); strcpy(test, pblock->getname()); if (_stricmp(pblock->getname(), blockname) == 0) { scale3d = pref->scalefactors(); if ( pref->getgeomextents(ext) != eok ) continue; } } } scalefactors() returns the right scale. however, the getgeomextents doesn't return eok. thanks, al |
所有的时间均为北京时间。 现在的时间是 04:54 AM. |