![]() |
【转帖】how to use the function getboundingpoints of oddbmte
how to use the function getboundingpoints of oddbmtext?
how to use the function getboundingpoints of oddbmtext? how to use the function getboundingpoints of oddbmtext? 1)box from oddbmtext->getboundingpoints() is not supporting with rotation of text. and 2)the return value from oddbmtext->actualwidth is zero,incorrect? quote: originally posted by susheng how to use the function getboundingpoints of oddbmtext? 1)box from oddbmtext->getboundingpoints() is not supporting with rotation of text. and 2)the return value from oddbmtext->actualwidth is zero,incorrect? could you describe the your problem more detail. oddbmtext->getboundingpoints() takes into account text rotation and uses oddbmtext->actualwidth for calculation points. -- best regards, sergey z. oddbblocktablerecordptr pblock = pinfo->hblock.safeopenobject(oddb::kforwrite); oddbrotateddimensionptr pad = oddbrotateddimension::createobject(); oddbobjectid piddim; piddim = pblock->appendoddbentity(pad); pad->setdatabasedefaults(m_pdb); oddbobjectiteratorptr piter = pblock->newiterator(); for (piter->start(); ! piter->done(); piter->step()) { oddbentityptr pentity = piter->objectid().safeopenobject(); if(pentity->iskindof(oddbmtext::desc())) { oddbmtext->getboundingpoints(acgepoint3darray array); } } the above parameters as array(acgepoint3darray ) is not rotated before dimension is rotated. 2)oddbmtext->actualwidth oddbobjectid pidstyle = pmtext->textstyle(); oddbtextstyletablerecordptr pstyle = pidstyle.safeopenobject(oddb::kforread); oddbtextstyletablerecordptr pstylenew = pstyle->clone(); cstring strname; strname.format("ts%x", m_nnamecounter++); pstylenew->setname((lpctstr)strname); pstylenew->setfilename("gbenor.shx"); pstylenew->setbigfontfilename("gbcbig.shx"); pstylenew->setxscale(1.0); oddbobjectid pidtable = m_pdb->gettextstyletableid(); oddbtextstyletableptr ptable = pidtable.safeopenobject(oddb::kforwrite); oddbobjectid pidstylenew = ptable->add(pstylenew); pmtext->settextstyle(pidstylenew); real64 txtwidth = pmtext->actualwidth(); the parameter as txtwidth(real64) is incorrect compared to actual width of text. quote: originally posted by susheng oddbblocktablerecordptr pblock = pinfo->hblock.safeopenobject(oddb::kforwrite); oddbrotateddimensionptr pad = oddbrotateddimension::createobject(); oddbobjectid piddim; piddim = pblock->appendoddbentity(pad); pad->setdatabasedefaults(m_pdb); oddbobjectiteratorptr piter = pblock->newiterator(); for (piter->start(); ! piter->done(); piter->step()) { oddbentityptr pentity = piter->objectid().safeopenobject(); if(pentity->iskindof(oddbmtext::desc())) { oddbmtext->getboundingpoints(acgepoint3darray array); } } the above parameters as array(acgepoint3darray ) is not rotated before dimension is rotated. mtext entity is some text in pblock which isn't related to rotated dimension. your pblock contents rotateddimension too. note: -use dimblockid() method of dimension entity for getting dimension block. - dimension is rotated not mean what text will be rotated in dimension block. best regards, sergey z. quote: originally posted by susheng 2)oddbmtext->actualwidth oddbobjectid pidstyle = pmtext->textstyle(); oddbtextstyletablerecordptr pstyle = pidstyle.safeopenobject(oddb::kforread); oddbtextstyletablerecordptr pstylenew = pstyle->clone(); cstring strname; strname.format("ts%x", m_nnamecounter++); pstylenew->setname((lpctstr)strname); pstylenew->setfilename("gbenor.shx"); pstylenew->setbigfontfilename("gbcbig.shx"); pstylenew->setxscale(1.0); oddbobjectid pidtable = m_pdb->gettextstyletableid(); oddbtextstyletableptr ptable = pidtable.safeopenobject(oddb::kforwrite); oddbobjectid pidstylenew = ptable->add(pstylenew); pmtext->settextstyle(pidstylenew); real64 txtwidth = pmtext->actualwidth(); the parameter as txtwidth(real64) is incorrect compared to actual width of text. pmtext->actualwidth() is depend on font (and font must be accessible in your system). you change style (and font in style) so actualwidth() may be change. best regards, sergey z. |
所有的时间均为北京时间。 现在的时间是 09:24 PM. |