如何读取图上的多行文字信息?
MXCAD手机版|冯美娟|2018-07-20 09:33
-
回答:
代码实现如下:
MrxDbgSelSet ss = new MrxDbgSelSet(); ss.allSelect(); for(int i = 0; i <ss.size();i++) { long lId = ss.at(i); McDbEntity ent = new McDbEntity (lId); // 得到对象的层名. Log.e("LayerName",ent.layerName()); String sName = MxFunction.getTypeName(lId); if(sName.equals("McDbMText")) { McDbMText txt = new McDbMText(ss.at(i)); McGePoint3d pos = txt.location(); String sTxt = txt.contents(); double dH = txt.textHeight(); String sT; sT = String.format(" pos:%f,%f,Txt:%s,H:%f",pos.x,pos.y,sTxt,dH); Log.e("McDbMText",sT); }