setXData() will replace any xdata with the same RegApp name as that in the
data being passed into it. So, what you are doing is fine (and is the only
way to do it). If you pass in a RegApp name with no data after it, then
that RegApp name and any data associated with it will be removed from the
object.
"Jörg Kühne" wrote in message
news:1303D6282BB2B6BE459C8908412E7AF4@in.WebX.maYIadrTaRb...
> Hello,
>
> I created a Blockreference that contains xdata. After this I want to
change
> the values of the of xdata without erasing the whole Blockreference. I did
> not find a methode like RemoveXdata (in the opposite to setXData). If I
use
> setXData serveral times for the same Entity did it automatically
overwrites
> the old xdata ? The follwing sample code works, but Im not sure if it is a
> legal way to exchange the Xdata ?
>
> (code without any errorchecking)
> ...
> acdbRegApp(szAppname);
> xdata=acutBuildList(...........) // My First Data
> acdbOpenObject(pObj,eId,AcDb::kForWrite);
> pObj->setXData(xdata);
> pObj->close();
> acutRelRb(xdata);
> ....
>
> ...
> acdbRegApp(szAppname);
> xdata=acutBuildList(...........) // My Changed Data
> acdbOpenObject(pObj,eId,AcDb::kForWrite);
> pObj->setXData(xdata);
> pObj->close();
> acutRelRb(xdata);
> ....
>
> Thank you
> Jörg
>
>
> PS: Thanks Art Cooney for ansering my last question
>
>
>
>