![]() |
【转帖】[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. |