The following ObjectARX / Lisp code removes XData that is attached to an entity regardless of the APPNAME. Use it with caution and only if you need to do this, since removing XData from an entity without considering the appname may cause plug-ins that rely on them to misbehave.
Here is the ObjectARX code :
static void AdskTestCommand(void)
{
ads_name eNam;
ads_point pt;
int ret;
ret = acedEntSel(ACRX_T("\nPick an entity :"), eNam, pt);
if (RTNORM != ret)
return;
AcDbObjectId ObjId;
acdbGetObjectId(ObjId, eNam);
AcDbEntity *pEnt = NULL;
Acad::ErrorStatus es
= acdbOpenAcDbEntity(pEnt, ObjId, AcDb::kForWrite);
resbuf *xdata = pEnt->xData(NULL);
if (xdata)
{
xdata->rbnext = NULL;
pEnt->setXData(xdata);
acutRelRb(xdata);
}
pEnt->close();
}
Here is the Lisp code:
(defun c:DelXdata()
(setq l (car (entsel "Pick object:")))
(if l (progn
(redraw l 3)
(setq le (entget l '("*")) )
(setq xdata (assoc '-3 le))
(setq le
(subst (cons (car xdata) (list (list (car (car (cdr xdata))))))
xdata le))
(entmod le)
(redraw l 4)
le
)
)
)