Xrecords

Xrecords enable you to add arbitrary, application-specific data. Because they are an alternative to defining your own object class, they are especially useful to AutoLISP ® programmers. An xrecord is an instance of class AcDbxrecord, which is a subclass of AcDbObject. Xrecord state is defined as the contents of a resbuf chain, which is a list of data groups, each of which in turn contains a DXF group code plus associated data. The value of the group code defines the associated data type. Group codes for xrecords are in the range of 1 through 369. The following section describes the available DXF group codes.

There is no inherent size limit to the amount of data you can store in an xrecord. Xrecords can be owned by any other object, including the extension dictionary of any object, the named object dictionary, any other dictionary, or other xrecords.

No notification is sent when an xrecord is modified. If an application needs to know when an object owning an xrecord has been modified, the application will need to send its own notification.

The AcDbXrecord class provides two member functions for setting and obtaining resbuf chains, the setfromRbChain() and rbChain() functions:

Acad::ErrorStatus
AcDbXrecord::setFromRbChain(
    const resbuf& pRb,
    AcDbDatabase* auxDb = NULL);
 
Acad::ErrorStatus
AcDbXrecord::rbChain(
    resbuf** ppRb,
    AcDbDatabase* auxDb = NULL) const;

The AcDbXrecord::setFromRbChain() function replaces the existing resbuf chain with the chain passed in.