如何交互生成面域对象 代码:
AcDbObjectId eId; AcDbEntity * ent; ads_name en; int rc = acdbEntLast(en); //获取数据库中任意一个实体 if (rc != RTNORM) { acutPrintf("the database has nothing.\n", rc); } if(!acedCommand(RTSTR,"-boundary",RTSTR,PAUSE,RTSTR,"",RTNONE)) return; //调用命令生成边界 for(;;) //边界可能是嵌套型的,也就是有孤岛,所以进行循环 { int rc = acdbEntNext(en,en); //获取生成的边界 if (rc != RTNORM) break; //已经没有边界实体,退出循环 acdbGetObjectId(eId, en); acdbOpenObject(ent, eId,AcDb::kForRead); ent->close(); if(ent->isKindOf(AcDbPolyline::desc())) //生成的应是AcDbPolyline实体 //.................. //create region object //这时就可以根据AcDbPolyline }; //的点的信息生成面域对象
|