几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   ObjectARX(C++) (http://www.dimcax.com/hust/forumdisplay.php?f=34)
-   -   【转帖】[arx][求助]关于acdbtext (http://www.dimcax.com/hust/showthread.php?t=6434)

yang686526 2009-04-16 11:49 AM

【转帖】[arx][求助]关于acdbtext
 
[arx][求助]关于acdbtext
[arx][求助]关于acdbtext
请问如何得到acdbtext的具体宽度?谢谢~~
//获得text文本的实际宽度
double gettexttruewidth(cstring stext, double dtextheight, cstring stextstyle)
{
acgitextstyle textstyle;
if(!stextstyle.isempty())
{
if(fromacdbtextstyle(textstyle, lpctstr(stextstyle)) != acad::eok) return 0.0;
}
else
{
if(fromacdbtextstyle(textstyle, acdbhostapplicationservices()->workingdatabase()->textstyle()) != acad::eok)
return 0.0;
}
textstyle.settextsize(dtextheight);
textstyle.loadstylerec();
acgepoint2d pt = textstyle.extents(lpctstr(stext), adesk::ktrue, -1, adesk::kfalse);
return pt.x;
}
使用acdbentity::getgeomextents 函数可以得到物件的在下和右上点
我的作品,您的选择//www.umould.com/thread-1637-1-1.html


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