如何读取图上的椭圆信息?
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("McDbEllipse")) { McDbEllipse ellipse = new McDbEllipse(ss.at(i)); McGePoint3d cen = ellipse.center(); McGeVector3d major = ellipse.majorAxis(); double radius = ellipse.radiusRatio(); double sang = ellipse.startAngle(); double eang = ellipse.endAngle(); String sT; sT = String.format(" cen:%f,%f,major:%f,%f,radius:%f,sang:%f,eang:%f",cen.x,cen.y,major.x,major.y,radius,sang,eang); Log.e("McDbEllipse",sT); }