ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

getXDATA and CList

1 REPLY 1
Reply
Message 1 of 2
ZK_BUDiKOM
344 Views, 1 Reply

getXDATA and CList

Hello,

 

I have a function, to read and print XDATA from Object:

 

// This function calls the selectObject() function to allow
// the user to pick an object; then it accesses the xdata of
// the object and sends the list to the printList() function
// that lists the restype and resval values.
void C_XDATA::ReadXdata(ACHAR sAppName[255], AcDbObjectId pObjID, ads_name adsNewObj)
{
// Get the xdata for the application name.
struct resbuf *pRb;
AcDbObject* pObj;
acdbGetObjectId(pObjID, adsNewObj);
if (acdbOpenObject(pObj, pObjID, AcDb::kForWrite) == Acad::eOk)
{
pRb = pObj->xData(sAppName);
if (pRb != NULL) {
// Print the existing xdata if any is present.
// Notice that there is no -3 group, as there is in
// LISP. This is ONLY the xdata, so
// the -3 xdata-start marker isn't needed.

 

//  WHAT HERE ??

acutPrintf(_T("\XDATA is ok!\n"));
acutRelRb(pRb);
} else {
acutPrintf(_T("\nNo xdata for this appname"));
}
}
pObj->close();
}

 

Also I have declared in header file:

struct MY_XDATA
{
CString sXdataName;
CString sXdataValue;
};

 

and:

CList<MY_XDATA, MY_XDATA> m_LstXdata;
CList<MY_XDATA, MY_XDATA>* m_pLstXdata;

 

 

Can someone tell me what I should do to get the list with all XDATA?

 

regards

Tags (1)
1 REPLY 1
Message 2 of 2
owenwengerd
in reply to: ZK_BUDiKOM

The source code for the ArxDbg sample contains code for displaying xdata.

--
Owen Wengerd
ManuSoft

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost