几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】how to use the function getboundingpoints of oddbmte (http://www.dimcax.com/hust/showthread.php?t=16798)

yang686526 2009-05-06 03:24 PM

【转帖】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.


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