- 积分
- 19100
- 明经币
- 个
- 注册时间
- 2003-8-16
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2008-9-27 09:17:00
|
显示全部楼层
- //编程:包达勇
- //2008-09-27 上午9:16
- ads_real Dist1,Dist2;
- ads_name Ename,Ename1;
- ads_point pt,p1,p2;
- AcDbObjectId ObjID,NewID;
- AcDbEllipse *pEll;
- AcGePoint3d Spt,Ept;
- if (acedEntSel("\n请您选取要椭圆对象:",Ename,p1)!=RTNORM)return;
- if (acdbGetObjectId(ObjID,Ename)!=eOk)return;
- acdbOpenObject(pEll,ObjID,AcDb::kForRead);
- Spt=(AcGePoint3d&)pEll->minorAxis();
- Ept=(AcGePoint3d&)pEll->majorAxis();
- pEll->close();
- pt[X]=pt[Y]=pt[Z]=0;
- ads_point_set(asDblArray(Spt),p1);
- ads_point_set(asDblArray(Ept),p2);
- Dist1=acutDistance(pt,p1);
- Dist2=acutDistance(pt,p2);
- acutPrintf("\n报告:\n椭圆的长半轴=%fmm\n椭圆的短半轴=%fmm\n编程:BDYCAD <2008-09-27>",Dist2,Dist1);
复制代码 |
|