lgtq 发表于 2006-3-10 21:15:00

诸位朋友,如何 用setxdata 方法删除实体扩展数据?

我是这样做的,但是错了....
我调了一晚上,郁闷的很.
void clearname(AcDbPolyline* pPolyline)
{ structresbuf*pRb=NULL;
pPolyline->upgradeOpen();
pPolyline->setXData(pRb);
pPolyline->close();
acutRelRb(pRb);
}

lgtq 发表于 2006-3-10 21:26:00

我 pRb->...type=1001也试过 不行.

chengxdong 发表于 2006-7-20 20:23:00

我试过,可以的.
pRb->restype=1001;
   pTemp = pRb;
   pTemp->rbnext=NULL;
pObj->setXData(pRb)

pipilu 发表于 2006-7-25 16:37:00

//----------------------------------------------------------------------------------------------------
// created: 22/7/2006   17:53   ShangHai
// author: &nbspiPi
// 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()

fuzhishui 发表于 2014-6-17 22:19:00


兄弟   太谢谢你了
页: [1]
查看完整版本: 诸位朋友,如何 用setxdata 方法删除实体扩展数据?