XATTACH — Attach DWG
Attaches a DWG or DXF drawing as an external reference.
- Command:
XATTACH· Global name:_XATTACH· Alias:XA - Ribbon: Insert › Reference
Attaches another DWG or DXF drawing as an external reference: it is shown in place inside the current drawing, but it is not copied. The drawing only stores the file path and reads the file again each time it is opened.
Usage
- Enter XATTACH (or XA), or click Attach DWG… in the XREF window.
- Enter the file path, or press Enter to choose it in a file dialog.
Enter name of file to attach or [Browse] <Browse>:
- Specify the insertion point (Enter: the origin).
Specify insertion point or [Overlay/pathType]:
- Enter the X scale; Enter keeps 1.
Enter X scale factor <1>:
- Enter the Y scale; Enter uses the same as X.
Enter Y scale factor <use X scale factor>:
- Enter the rotation angle, or specify a point in that direction.
Specify rotation angle <0>:
In the interface (not in scripts, SCRIPT or AutoLISP), after choosing the file the Attach External Reference dialog box opens: the reference type (attachment or overlay), the path type and the insertion point, X, Y and Z scale and rotation; whatever you leave as Specify On-screen is specified afterwards, with the prompts of steps 3 to 6. The dialog box cannot be scripted in the AutoCAD console: it has a unit test.
Options
- Overlay (O): the reference is overlaid instead of attached. An overlay is not shown in the drawings that attach this one. The prompt then offers Attach (A) to switch back.
Specify insertion point or [Attach/pathType]:
- pathType (T): chooses how the file path is saved. Enter keeps the value of REFPATHTYPE.
Path type [Full/Relative/No path] <Relative>:
- Full (F), Relative (R) or No path (N): the full path, a path relative to the drawing's folder, or just the file name (looked for in the drawing's folder). If the drawing has not been saved yet or the file is on another drive, the relative path is saved as a full one.
Notes
- The layers of the attached drawing appear as
reference|layer. Their color or visibility changes are kept when it is reloaded if VISRETAIN is 1. - If the reference is already defined in the drawing, the same one is inserted again. A file that is already a normal block of the drawing is not attached, nor one that attaches (directly or indirectly) the current drawing: that would be a circular reference.
- Its content is drawn somewhat faded, according to XFADECTL, to tell it apart from your own objects.
- For a PDF, use PDFATTACH; for an image, IMAGEATTACH.
See also
XREF · -XREF · XCLIP · INSERT · External references