如何读取图上的文字信息?
MXCAD手机版|冯美娟|2018-07-20 09:32
-
回答:
代码实现如下:
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("McDbText")) { McDbText txt = new McDbText(ss.at(i)); McGePoint3d pos = txt.position(); String sTxt = txt.textString(); double dH = txt.height(); String sT; sT = String.format(" pos:%f,%f,Txt:%s,H:%f",pos.x,pos.y,sTxt,dH); Log.e("McDbText",sT); }