如何读取图上直线坐标?
MXCAD手机版|冯美娟|2018-07-20 09:30
-
回答:
代码实现如下:
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("McDbLine")) { McDbLine line = new McDbLine(ss.at(i)); McGePoint3d sPt = line.getStartPoint(); McGePoint3d ePt = line.getEndPoint(); String sT; sT = String.format("sPt:%f,%f,%f,ePt:%f,%f,%f",sPt.x,sPt.y,sPt.z,ePt.x,ePt.y,ePt.z); Log.e("Linedata",sT); }