- 积分
- 1696
- 明经币
- 个
- 注册时间
- 2010-10-22
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
本帖最后由 sunny20102 于 2012-11-20 08:02 编辑
- static void massmass(void)
- {
- // Add your code for command mass.mass here
- ads_name en;
- ads_point pt;
- if(acedEntSel(_T(""),en,pt)!=RTNORM)
- return;
- AcDbObjectId id;
- acdbGetObjectId(id,en);
- AcDbRegion *pEnt;
- acdbOpenObject(pEnt,id,AcDb::kForRead);
- if(!pEnt->isKindOf(AcDbRegion::desc()))
- {
- acutPrintf(_T("\n所选择实体非面域!"));
- pEnt->close();
- return;
- }
- AcGePoint3d origin;
- AcGeVector3d xAxis;
- AcGeVector3d yAxis;
- double perimeter;
- double area;
- AcGePoint2d centroid;
- double momInertia[2];
- double prodInertia;
- double prinMoments[2];
- AcGeVector2d prinAxes[2];
- double radiiGyration[2];
- AcGePoint2d extentsLow;
- AcGePoint2d extentsHigh;
- pEnt->getAreaProp(origin,xAxis,yAxis,perimeter,area,centroid,momInertia,prodInertia,prinMoments,prinAxes,radiiGyration,extentsLow,extentsHigh);
-
- acutPrintf(_T("\n Area: %f"),area);
- acutPrintf(_T("\n Perimeter: %f"),perimeter);
- pEnt->close();
- }
复制代码 |
|