- UID
- 63645
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2003-7-9
- 最后登录
- 1970-1-1
|
发表于 2003-11-12 10:22:57
|
显示全部楼层
我有一个原码,自已看看吧:
#define GET_EN(x) if(rb&&(rb->restype==RTENAME)){NAME_SET(x,rb->resval.rlname);rb=rb->rbnext;}
int f_getxx(resbuf* rb)
{
ads_name en;
AcDbObjectId objId;
Acad::ErrorStatus es;
GET_EN(en);
es = acdbGetObjectId(objId, en);
if (Acad::eOk != es)
{
ads_printf("\nFailed to get object Id");
return -1;
}
AcDbEntity * pEnt;
es =acdbOpenAcDbEntity(pEnt,objId,AcDb::kForRead,Adesk::kFalse);
if(Acad::eOk != es)
{
ads_printf("\nFailed to open entity for write");
return -1;
}
AcDbRegion *pRegion = AcDbRegion::cast(pEnt);
if (pRegion == NULL)
ads_printf("\nThe impossible has happened! 不是一个面域");
AcGePoint3d origin;
AcGeVector3d xAxis;
AcGeVector3d yAxis;
AcGePlane plane;
pRegion->getPlane(plane);
plane.getCoordSystem(origin, xAxis, 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;
pRegion->getAreaProp(origin,
xAxis,
yAxis,
perimeter,
area,
centroid,
momInertia,
prodInertia,
prinMoments,
prinAxes,
radiiGyration,
extentsLow,
extentsHigh) ;
return 1;
} |
|