|  | 
 
发表于 2006-7-25 16:37:00
|
显示全部楼层
 
| //---------------------------------------------------------------------------------------------------- // created: 22/7/2006   17:53   ShangHai
 // author:  iPi
 // purpose: Delete X-Data of a entity, no matter if there is X-Data attached to the entity
 //              when we fail to store a flange,but some information has already been added as x data,
 //              we need to delete these x data for consistency
 //----------------------------------------------------------------------------------------------------
 bool DelXData(AcDbObjectId adoiEntity)
 {
 //Open the entity for editing
 AcDbEntity *padEntity;
 if (acdbOpenAcDbEntity(padEntity, adoiEntity, AcDb::kForWrite) != Acad::eOk) {
 return false;
 }//end if
 //Get x data result buffer of the entity
 resbuf *rbXdata = padEntity->xData(NULL);
 //result buffer not null
 if (rbXdata) {
 rbXdata->rbnext = NULL;
 padEntity->setXData(rbXdata);
 acutRelRb(rbXdata);
 }//end if
 padEntity->close();
 return true;
 }//end of function : DelXData()
 
 | 
 |