Commands

ATTIN command in AutoCAD : Imports block attribute values from an external, tab-delimited ASCII file

If you need to import or update block attribute values in AutoCAD from an external text file, the ATTIN command is the standard, built-in tool. This guide explains clearly what ATTIN does, how to use it step‑by‑step, common problems and fixes, alternatives, practical tips, and a helpful FAQ for quick answers.


What is the ATTIN command?

ATTIN (Attribute Import) in AutoCAD imports block attribute values from a tab‑delimited ASCII text file into drawing block references. It is normally used together with ATTOUT, which exports current attribute values to a text file you can edit (for example in Excel) and then re‑import with ATTIN to update many blocks at once.

Key points:

  • ATTIN expects a tab‑delimited ASCII file (usually created by ATTOUT).
  • Each record (row) represents a block instance and the fields (columns) represent values for that block’s attribute tags in a consistent order.
  • ATTIN updates attribute values of existing block references — it does not change block definitions or add attributes.

How ATTIN works (high‑level explanation)

  • You export attribute data with ATTOUT filename.txt. That creates a text file with the attribute data in a specific tab‑delimited format.
  • You edit that file (for example, correct part numbers, update door sizes, change descriptions).
  • You re‑import the edited file with ATTIN filename.txt. AutoCAD matches records to block references and updates the attribute values accordingly.
  • If tags or block names don’t match the data file, those records are skipped.
Read Also:  ARRAYPOLAR command in AutoCAD : Evenly distributes object copies in a circular pattern around a center point or axis of rotation

How to use ATTIN — Step by step

Preparation: Export current attribute data (recommended)

  1. In AutoCAD, run the command ATTOUT.
  2. When prompted, enter a file name (for example, attributes.txt) and save it. This file will be tab‑delimited and is the recommended starting point for the format ATTIN expects.

Edit the exported file safely

  1. Open the .txt file in Excel (use the Text Import wizard and choose Tab as delimiter) or a plain text editor.
  2. Make only the required edits to the attribute values. Do not change the order of the columns produced by ATTOUT, and do not delete the header rows if present.
    • In Excel, set columns containing numbers or codes to Text format to avoid scientific notation or truncation.
  3. Save the edited file as *Text (Tab delimited) (.txt)** or a plain ASCII text file. Avoid adding a BOM (Byte Order Mark) — if your editor offers ANSI encoding, choose that.

Import back into AutoCAD

  1. In AutoCAD, run the command ATTIN.
  2. Select the edited .txt file when prompted.
  3. Let ATTIN process: it will search for matching block instances and update their attributes with the values from the file.
  4. Review the drawing to confirm attribute values updated correctly.

Example of a tab‑delimited file (conceptual)

(Fields separated by tabs — shown here with | to visualize columns)

BlockNameHandleTag1Tag2Tag3
DOOR_A1234D‑100900×2100WOOD
WINDOW_B2345W‑2001200×1500ALUM

Notes:

  • The exact columns and header layout depend on how ATTOUT produced the file. Use ATTOUT as the template and preserve column order.
  • Do not convert the file to CSV unless you also ensure ATTIN will accept the delimiter; ATTIN expects tabs.

Common reasons ATTIN doesn’t work and how to fix them

  • File format changed (delimiters or column order):

    • Fix: Use the file produced by ATTOUT as the model. If you edit columns, do not reorder them. Keep tabs as separators.
  • Encoding / BOM problems (UTF‑8 with BOM can break parsing):

    • Fix: Save the file as ANSI or UTF‑8 without BOM if your editor supports it. Avoid adding special characters.
  • Attribute tag names or block names don’t match:

    • Fix: Confirm attribute tags and block names match exactly (check spelling and spaces). When in doubt, use BATTMAN or the block editor to inspect attribute tag names.
  • Blocks have no attributes (or attributes are constant fields):

    • Fix: Ensure the block references in the drawing actually contain attributes (not attributes in the block definition only). ATTIN updates attribute instances.
  • You edited numeric values and Excel changed format (scientific notation, removed leading zeros):

    • Fix: Format columns as Text before editing in Excel, or prefix values with apostrophe to preserve formatting.
  • File path or permissions problem:

    • Fix: Place the file on a local drive or in a folder AutoCAD can access. Ensure the file is not read‑only.
  • Some records skipped:

    • Fix: Check the skipped records in the file for mismatched block names, missing tags, or malformed rows (extra tabs, blank lines).
  • ATTIN imported but values look wrong (wrong columns used):

    • Fix: Restore original ATTOUT format and re‑import. If you created the text file manually, ensure the columns match exactly the order ATTIN expects.
Read Also:  3DCLIP command in AutoCAD : Opens the Adjust Clipping Planes window, where you can specify what portions of a 3D model to display

Alternative methods to update or manage attribute data

  • BATTMAN (Block attribute manager):

    • Use to edit attribute definitions in block definitions (useful when you want to change default values, prompts, or visibility).
  • EATTEDIT / Express Tools (if installed):

  • Properties palette:

    • Select individual block references and edit attribute values in the Properties panel (not suitable for large batches).
  • DATAEXTRACTION (data extraction wizard):

    • export attributes to a table or Excel file for reporting. DATAEXTRACTION is not primarily an import tool, but it helps manage attribute data and can be combined with scripts/tools for reimport.
  • custom scripts or LISP routines:

    • For advanced or repeated workflows, consider a small AutoLISP or script that reads a text file and assigns attribute values (gives full control over matching logic).
  • Third‑party utilities and plugins:

    • Several CAD utilities on the Autodesk App Store offer more robust attribute import/export including CSV support, mapping columns to tags, and logging.

Practical tips and best practices

  • Always make a backup of your drawing before running batch imports.
  • Use ATTOUT to create the initial file — it ensures the correct format for ATTIN.
  • When editing in Excel, set columns to Text to preserve leading zeros, long numbers, and formatting.
  • Keep a copy of the original exported file so you can compare and restore if needed.
  • If you must create a file manually, create a small test file and test on a copy of the drawing first.
  • If many blocks share the same tag names but different block names, ensure your file identifies the correct block type for each record.
  • Use descriptive file names and document the changes made in the text file (maintain versioning).
Read Also:  3DORBITCTR command in AutoCAD : Sets a specific center of rotation in 3D Orbit view

FAQ

What exact file format does ATTIN require?

ATTIN expects a tab‑delimited ASCII text file in the format produced by ATTOUT. Preserve the column order and tabs; avoid adding a BOM or using comma delimiters.

Can I import attributes for blocks that do not yet exist in the drawing?

No. ATTIN updates existing block references only. If the corresponding blocks are not present, ATTIN will skip those records.

My numbers changed to scientific notation after editing in Excel — how do I avoid that?

Format the Excel columns as Text before entering or pasting values. Alternatively, prefix values with an apostrophe (‘) so Excel treats them as text.

Does ATTIN change block definitions?

No. ATTIN updates attribute instances on block references. To change attribute definitions inside a block (tags, prompts, default values), use BATTMAN or edit the block definition.

How do I know which records were updated or skipped?

ATTIN does not produce a detailed log by default. Best practice: keep the original ATTOUT file, make small test imports, or use a custom script/LISP that can log matches and skips.

Can I use a CSV (comma separated) file instead of a tab file?

ATTIN expects tabs. If you have CSV data, convert it to tab‑delimited text and ensure the encoding is ASCII/ANSI or UTF‑8 without BOM before importing.

Why are some attributes not updating even though the block exists?

Common reasons: mismatch in attribute tag names, the block reference has no attribute instances, or the row in the text file is malformed. Verify tag names and inspect the block reference with the Properties palette or in the Block Editor.

Is ATTIN case sensitive when matching tags or block names?

Attribute tag matching is typically not case sensitive, but it’s safest to match the exact spelling, including spaces. In practice, mismatches caused by extra spaces or different punctuation will prevent updates.