![]() |
【转帖】dimension explode example
dimension explode example
dimension explode example hi i basicly uses dwgdirect to convert dwg files to dxf-files. i have no expierience in using the database system. now i need to explode entities of type dimension to the basic elements line, arc and text (or mtext), which will be easier to read. has anyone an example i can use: how to walk through all entities, find dimension, explode dimension, save the exploded entities to the database, so that i can save it with the dxf file including the exploded dimension's. laurs the code below loops through all entities in all blocks which are not anonimous and not xref and explodes all dimensions. code: oddbblocktableptr pblocktable = pdb->getblocktableid().safeopenobject(); oddbsymboltableiteratorptr pblockiter = pblocktable->newiterator(); while (!pblockiter->done()) { oddbblocktablerecordptr pblocktablerecord = pblockiter->getrecord(oddb::kforwrite); if ( !pblocktablerecord->isanonimous() && !pblocktablerecord->isfromexternalreference()) { oddbobjectiteratorptr pentiter = pblocktablerecord->newiterator(); while (!pentiter->done()) { oddbentityptr pent = pentiter->entity(); pentiter->step(); if (pent->iskindof(oddbdimension::desc())) { pent->upgradeopen(); // it was open for read if (pent->explodetoblock(pblocktablerecord) == eok) { pent->erase(); } } } } pblockiter->step(); } sergey slezkin hi sergey thanks, it is running (after isanonimous() was changed to isanonymous()) i know have a fundament to do other changes. best regards laurs hi sergey thanks, it is running (after isanonimous() was changed to isanonymous()) i now have a fundament to do other changes. best regards laurs |
所有的时间均为北京时间。 现在的时间是 11:30 AM. |