|
- static void asdkMyGroupMyCommand () {
- // Put your command code here
- ads采用name ss;
- if (RTNORM!=acedSSGet(NULL,NULL,NULL,NULL,ss))
- {
- return;
- }
- long slen;
- acedSSLength(ss,&slen);
- ads采用name en;
- AcDbObjectId id;
- AcDbEntity* pEnt=NULL;
- Acad::ErrorStatus es;
- AcDbVoidPtrArray ids;
- for (long i=0;i<slen;i++)
- {
- acedSSName(ss,i,en);
- acdbGetObjectId(id,en);
- es=acdbOpenAcDbEntity(pEnt,id,AcDb::kForWrite);
- if (es==Acad::eOk);
- {
- es=pEnt->explode(ids);
- }
- if (pEnt!=NULL)
- {
- pEnt->close();
- }
- }
- if (ids.isEmpty())
- {
- return;
- }
- int j=0;
- AcDbBlockTableRecordPointer btr(curDoc()->database()->currentSpaceId(),AcDb::kForWrite);
- if (btr.openStatus()!=Acad::eOk)
- {
- return;
- }
- bool flag=true;
- while(flag)
- {
- pEnt=(AcDbEntity *)ids.at(j);
- if (pEnt->explode(ids) !=Acad::eOk)
- {
- btr->appendAcDbEntity(pEnt);
- pEnt->close();
- }
- j++;
- if (j==ids.logicalLength())
- flag=false;
- }
- }
复制代码 |
|