块引用explode的问题
ads_name en;<BR> ads_point pt;<BR> AcDbObjectId eId,pId;<BR> AcDbVoidPtrArray aryId;<BR> AcDbEntity *pIte;<BR> AcDbBlockTable *pTb;<BR> AcDbBlockTableRecord *pBlockTableRecord;<BR> if(RTNORM==ads_entsel("\nSelect a object:",en,pt));<BR> {<BR> if (Acad::eOk==acdbGetObjectId(eId,en))<BR> {<BR> AcDbEntity *pEnt;<BR> AcDbObjectId id;<BR> if (Acad::eOk == acdbOpenObject(pEnt,eId,AcDb::kForWrite))<BR> {<BR> ads_printf("\nExplodeName= %s",pEnt->isA()->name());<BR> if (Acad::eOk==pEnt->explode(aryId))<BR> {<BR> pEnt->erase();<BR> for(int i=0;i<aryId.length();i++)<BR> {<BR> pIte=(AcDbEntity*)aryId.at(i);<BR> ads_printf("\nExplodeName= %s",pIte->isA()->name());<BR> acdbCurDwg()->getBlockTable(pTb,AcDb::kForRead);<BR> pTb->getAt(ACDB_MODEL_SPACE, pBlockTableRecord,AcDb::kForWrite);<BR> pTb->close();<BR> pBlockTableRecord->appendAcDbEntity(pId,pIte);<BR> pBlockTableRecord->close(); <BR> pIte->close();<BR> }<BR> }else<BR> {<BR> ads_printf("\nExplode failed!");<BR> } <BR> }<BR> pEnt->close();<BR> }<BR> }
代码对AcDbBlockReference的实体无效,总是返回failed,请问explode方法对块引用无效吗? 炸开只是虚的而已;实炸有个函数可调用的,到帮助文件里找找了;我只看过,没用过。不知道好不好用 explode函数对与定制实体需要重载,但是对于autocad本身的实体类型是不需要的。它返回explode后的实体的集合,你只要把他们加入数据库,然后删除原来的实体就可以了。但是对与AcDbBlockReference的对象就是不行。。。
还有人解答吗?
页:
[1]