Commands

ATTREDEF command in AutoCAD : Redefines a block and updates associated attributes

If you need to update attribute definitions inside block instances in AutoCAD, the attredef command is one of the tools that can help. This guide explains, step by step, what attredef does, how to use it, why it can fail, practical alternatives and reliable fixes. The content is beginner‑friendly and optimized for search queries About AutoCAD attribute updating.


What is the ATTREDEF command?

attredef is an AutoCAD command used to redefine attributes in blocks — that is, to update attribute definitions in block definitions and propagate those definition changes to existing block references in a drawing. Use this command when you change attribute definitions (for example: tag name, prompt text, default value, layer or visibility) in a block and you want the block instances in the drawing to reflect those changes.

Key points:

  • It works with blocks that contain attribute definitions (attributes created with ATTDEF when the block was built).
  • It attempts to bring existing block instances into alignment with the current block definition.
  • In many workflows you will also use related commands such as ATTSYNC, BATTMAN, BEDIT, and ATTEDIT.

When to use attredef (common use cases)

  • You changed an attribute tag or default value inside a block definition and need all existing inserted blocks to use the new definition.
  • You swapped a block definition with another and want to ensure attributes match the new definition.
  • You standardized attribute tags across several block types and need to update instances.
  • You inherited a drawing with mismatched attribute definitions and want to correct them.

Example scenario (before / after):

  • Before: Block “DOOR_TAG” has an attribute tag “TYPE” but some existing inserts still use an older tag or outdated default value.
  • After: Running attredef updates the block instances so they use the new TYPE tag and default value defined in the block definition.
Read Also:  ATTOUT command in AutoCAD : Exports block attribute values to an external file in tab-delimited ASCII format

How to use attredef — Step by step

Note: Exact prompts may vary slightly by AutoCAD version. The procedure below is a reliable, general workflow.

  1. Save a backup copy of your drawing before mass updates.
  2. Open the drawing and ensure the updated block definition (with the desired attribute definitions) is saved in the current drawing. You can edit the block with BEDIT or re-create it using BLOCK or INSERT.
  3. At the command line type: attredef and press Enter.
  4. When prompted, select the block(s) you want to update in the drawing (click each block or use a window selection). You can often select multiple blocks at once.
  5. Confirm the selection and follow any on-screen prompts (for example, to accept or replace attribute definitions).
  6. After the command finishes, visually inspect sample block instances and use ATTEDIT or BATTMAN to verify attribute definitions are correct.
  7. Run REGEN if necessary to refresh the display.

Shortcut: Type attredef at the AutoCAD command line (you can create an alias if you use this often).

Practical tips during the process:

  • If you edited the block in the block editor (BEDIT), save and exit the editor before running attredef.
  • Use BATTMAN (Block attribute manager) to view and edit attribute definitions for a block interactively before redefining.
  • Test on a small set of blocks first before applying to the entire drawing.

Alternatives and complementary commands

  • ATTSYNC — Commonly used to synchronize attribute definitions in existing block references with the current block definition. Use when you want to update all block references of a specified block name to match the block definition.
  • ATTDEF — Creates attribute definitions when building block definitions.
  • ATTEDIT — Edit attribute values in an individual block reference.
  • BATTMAN — Block Attribute Manager. Edit attribute definitions inside block definitions (tag names, prompts, default values, visibility) via a dialog/list interface.
  • BEDIT / REFEDIT — Edit the block definition directly in the Block Editor or Reference Editor.
  • -BLOCK (command-line BLOCK) or BLOCK with Replace options — rebuild or replace block definitions via the command-line form.
  • Explode and recreate — last resort: Explode block instances, delete old block definition, recreate block, reinsert (loses associative behavior and attribute history; use only if other methods fail).
Read Also:  ARCHIVE command in AutoCAD : Packages the current sheet set files for storage

Which to use?

  • Use ATTSYNC when you want a straightforward synchronization of attribute structure from the block definition to its instances.
  • Use BATTMAN and BEDIT to adjust definitions before synchronizing.
  • Use attredef when you specifically need to redefine attributes as offered by that command (some workflows or versions prefer it).

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

  1. Block definition wasn’t actually updated

    • Fix: Open block in BEDIT or recreate it with BLOCK so the drawing contains the updated definition before running attredef.
  2. You selected the wrong blocks or block name mismatch

    • Fix: Verify block names (use the BLOCKS palette or Properties) and select the correct block instances. Use SELECTSIMILAR for many identical blocks.
  3. Attributes are invisible or on a frozen layer

    • Fix: Turn on the layer(s) containing attributes, unfreeze and thaw layers, then run the command again.
  4. Nested or dynamic blocks causing unexpected behavior

    • Fix: For nested blocks, update parent and child blocks separately. For dynamic blocks, edit the definition in BEDIT and then synchronize.
  5. Locked or write-protected drawing or layers

    • Fix: Ensure the drawing is not read-only, and the layers containing attributes are not locked.
  6. Command not available or not recognized

    • Fix: Ensure you are using a supported AutoCAD version (some commands differ in AutoCAD LT or verticals), or add a Command alias. Use ATTSYNC as a reliable alternative.
  7. Attribute tags differ between block definition and instances

    • Fix: Use BATTMAN to standardize tags, or use ATTSYNC to force synchronization. If you intentionally changed tags, you may need to map old tags to new ones using a script or manual edit.
  8. Attribute values reverted or cleared after update

    • Fix: When attribute definitions change (for example default value), some updates may overwrite existing attribute values. Export attribute values first (DATAEXTRACTION or EATTEXT/ATTEXT utilities), then reimport after updating if required.
Read Also:  3DOSNAP command in AutoCAD : Sets the object snap modes for 3D objects

Practical tips and best practices

  • Always create a backup before mass attribute updates.
  • Use BATTMAN to preview and adjust definitions before applying global changes.
  • When changing attribute tags, plan for migrating existing values — you may need a script or data extraction workflow to preserve or remap values.
  • Prefer ATTSYNC for many standard synchronization tasks; it is widely used and predictable.
  • Work on a copy of the drawing if you are unfamiliar with the command’s effects.
  • For repeated updates, consider creating a small LISP or script to automate selection and synchronization.
  • Maintain consistent naming conventions and attribute tag standards across your Block library to avoid future issues.

FAQ

What is the difference between attredef and attsync?

Answer: Both commands help update Block attributes, but ATTSYNC is commonly used to synchronize attribute definitions in all block references to match the current block definition. ATTREDEF is another tool that can be used to redefine attribute definitions in blocks; depending on version and workflow, ATTSYNC is often the safer, more predictable choice. If one does not achieve the result you need, try the other and verify the block definition first.

How can I update attributes without losing current attribute values?

Answer: Before redefining or synchronizing, export current attribute values using Data Extraction or the extraction utilities (e.g., EATTEXT/ATTEXT), then apply the updates and reimport or remap values as needed. If you change only non-value properties (like prompts or layer) and not tags, values are less likely to be lost.

Why did attribute values become blank after updating?

Answer: This can happen if the attribute definitions in the new block use different tags or default values and the update overwrote instance values. To prevent this, export values before changes or carefully plan tag changes and use scripts to remap old tags to new tags.

Can I update nested blocks or Dynamic block attributes?

Answer: Yes, but you may need to update parent and child blocks separately. Edit nested block definitions in BEDIT and then run synchronization commands. For dynamic blocks, update the block definition in the Block Editor and then synchronize.

What if attredef/attsync doesn’t run in AutoCAD LT?

Answer: Some commands behave differently or are unavailable in AutoCAD LT. If a command is missing, use BATTMAN, BLOCK replace methods, or manual reinsert workflows. Consult AutoCAD LT documentation for the exact alternatives.

How do I batch-update many drawings with the same attribute change?

Answer: Use a script, batch routine, or LISP to open each drawing, apply the block update (e.g., insert updated block definition or run ATTSYNC/attredef), save the drawing, and close. Autodesk’s batch utilities or a simple script can automate the process.