查看单个帖子
旧 2009-05-06, 03:24 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)