Extended data can contain handles (group 1005) to save relational structures within a drawing. One entity can reference another by saving the other entity's handle in its extended data. The handle can be retrieved later and passed to acdbHandEnt() to obtain the other entity. Because more than one entity can reference another, extended data handles are not necessarily unique; the AUDIT command does require that handles in extended data are either NULL or valid entity handles (within the current drawing). The best way to ensure that extended entity handles are valid is to obtain a referenced entity's handle directly from its definition data, by means of acdbEntGet(). (The handle value is in group 5 or 105.)
To reference entities in other drawings (for example, entities that are attached by means of an xref), you can avoid protests from AUDIT by using extended entity strings (group 1000) rather than handles (group 1005), because the handles of cross-referenced entities either are not valid in the current drawing or conflict with valid handles. However, if an XREF Attach changes to an XREF Bind or is combined with the current drawing in some other way, it is up to the application to revise entity references accordingly.
When an entity is placed in a block definition (by means of the BLOCK command), the entity within the block is assigned new handles. (If the original entity is restored with OOPS, it retains its original handles.) The value of any extended data handles remains unchanged. When a block is exploded (with EXPLODE), extended data handles are translated, in a manner similar to the way they are translated when drawings are combined. If the extended data handle refers to an entity not within the block, it is unchanged; but if the extended data handle refers to an entity within the block, it is assigned the value of the new (exploded) entity's handle.