怎么样把以前添加的AutoCAD扩展数据更新成新的或删除
下面是网上找到的清除扩展数据的代码,我看不懂
void delXdata() { ads_name eNam; ads_point pt; int ret = acedEntSel ("\nselect an object:", eNam, pt); if ( ret!= RTNORM) { return; } AcDbObjectId ObjId; acdbGetObjectId(ObjId, eNam); AcDbEntity *pEnt;
acdbOpenAcDbEntity(pEnt, ObjId, AcDb::kForWrite);
resbuf *xdata = pEnt->xData(NULL);
if (xdata) { xdata->rbnext = NULL; pEnt->setXData(xdata); acutRelRb(xdata); } pEnt->close(); } |