AutoCAD Tip: AutoCAD Metadata: Using XData and Object Data to Tag Geometry

February 11, 2026 2 min read

AutoCAD Tip: AutoCAD Metadata: Using XData and Object Data to Tag Geometry

Attach custom metadata to your geometry to drive smarter selection, automation, and downstream reporting. Here’s how to use Object Data (Map 3D) and Extended Data (XData) effectively in AutoCAD.

When to use what

  • XData (core AutoCAD): Lightweight, invisible tags stored on entities. Great for classifications, IDs, statuses, and quick flags that must travel with copies, blocks, and XREF bindings.
  • Object Data (AutoCAD Map 3D toolset): Schema-based tables attached to objects. Ideal for structured, GIS-like attributes (text, numbers, dates) with field definitions you control.

XData essentials

  • Always register your application name before writing XData: REGAPP (programmatically: (regapp "MYAPP")).
  • Data types and codes you’ll use most:
    • 1001 = application name
    • 1000 = string, 1070 = integer, 1040 = real, 1010 = point
    • 1002 = “(” and “)” to group lists
  • Size matters: keep per-application XData under ~16 KB. For larger payloads, prefer an Extension Dictionary + Xrecords.
  • Include a version field (e.g., VER=1) so you can evolve your schema safely.
  • Maintenance: purge stale regapps with -PURGE → Regapps (type “R”), then AUDIT.

Quick AutoLISP: add/read a simple XData tag

;; Attach STATUS=APPROVED under the MYAPP regapp
(defun c:TAGX (/ e)
  (if (setq e (car (entsel "\nSelect object to tag: ")))
    (progn
      (regapp "MYAPP")
      (entmod (append (entget e '("*"))
                      (list (list -3 (list (cons 1001 "MYAPP")
                                           (cons 1000 "STATUS")
                                           (cons 1000 "APPROVED"))))))
      (princ "\nXData attached.")
    )
  )
  (princ)
)

;; Read raw XData payload
(defun c:READX (/ e ed xd)
  (if (setq e (car (entsel "\nSelect object: ")))
    (progn
      (setq ed (entget e '("*")))
      (setq xd (cdr (assoc -3 ed)))
      (prin1 xd)
    )
  )
  (princ)
)

Pro tips for XData workflows

  • Selection by XData: build filters with ssget and the -3 group, e.g. (ssget "_X" '((0 . "LINE") (-3 ("MYAPP" (1000 . "STATUS") (1000 . "APPROVED"))))).
  • Blocks and copies inherit XData—useful for status tracking or linking to external records.
  • For robust metadata and UI editing, consider Property Set Definitions (Architecture toolset) or store larger data in Xrecords.
  • Data extraction: vanilla Data Extraction does not read XData; export via LISP/NET to CSV/Excel when needed.

Object Data (Map 3D) quick start

  • Define a table: ADEDEFDATA (name fields, types, defaults).
  • Attach to objects: ADEATTACHDATA.
  • Edit attributes: ADEEDITDATA; query and report via Map queries and reports.
  • Great for CAD+GIS, asset IDs, materials, or compliance fields you want users to edit without custom code.

Housekeeping and standards

  • Document your app names, field lists, and versioning in your CAD standards.
  • Automate attachments in templates, tool palettes, or scripts for consistency.
  • Periodically -PURGE Regapps to avoid file bloat from imported content.

Need guidance choosing between XData, Xrecords, Property Sets, or Object Data? Consult the experts at NOVEDGE. For licensing, toolset comparisons, and deployment advice on AutoCAD and specialized toolsets, visit NOVEDGE’s AutoCAD page.



You can find all the AutoCAD products on the NOVEDGE web site at this page.







Also in Design News

Subscribe

How can I assist you?