|
[code] ads_name en;
AcDbObjectId eId;
AcDbEntity *pEntity;
int rc = acdbEntLast(en); //获取数据库中任意一个实体
if (rc != RTNORM)
{
acutPrintf("the database has nothing./n", rc);
return 2;
}
if (!acedCommand(RTSTR, "-boundary", RTSTR, PAUSE, RTSTR, "", RTNONE))
return 3; //调用命令生成边界
for (;;) //边界可能是嵌套型的,也就是有孤岛,所以进行循环
{
int rc = acdbEntNext(en, en); //获取生成的边界
if (rc != RTNORM)
break; //已经没有边界实体,退出循环
acdbGetObjectId(eId, en);
acdbOpenObject(pEntity, eId, AcDb::kForRead);
if (pEntity->isKindOf(AcDbPolyline::desc())) //生成的应是AcDbPolyline实体
{
pEntity->highlight();
//这边处理
}
else
{
pEntity->close();
}
//eraseAEntity(eId);
//..................
//create region object //这时就可以根据AcDbPolyline
};
[/code] |
|