External References

External references (xrefs) can be created and manipulated through several global functions. These global functions mimic the AutoCAD XREF command capabilities. The functions provided are

For information on the AutoCAD XREF command, see the AutoCAD User's Guide.

The main programming consideration concerning xrefs is that, for every xref that is attached to a drawing, a separate database is created to represent the drawing containing the xref. A block table record in the main drawing contains the name of the external drawing and points to the entities of the model space of the externally referenced drawing. The xref database also contains other block table records and symbol table entries required to resolve all references from the main block table record (layers, linetypes, and so on).

You can create an editor reactor, as described in Notification, to monitor xref events. The AcEditorReactor class provides the following reactor callback functions:

When using these functions, be careful to notice which database is being returned. Also, be aware that the xref drawing can itself contain xrefs to additional drawings. For more information on the AcEditorReactor class, see the ObjectARX Reference.

Xref entities in a drawing can be modified, but they cannot be saved to the original xref drawing (the original drawing is read-only).