Drawing: Diff Two Revisions
drawing_diffCompare two drawing revisions by geometric signature to report changed, added, and removed entities by layer and type, optionally marking change clusters with revision clouds.
Instructions
Compare two revisions of one drawing by geometric signature (spec §10).
Entities are matched exactly first (type, layer, geometry rounded to tol,
text, block, attributes - handles do not matter), then by handle while
handles look stable, then by type + layer + nearest position within
move_tol; what is left is added or removed. The report counts changes by
layer and type, lists each changed entity with what changed (moved by, text
from -> to, attribute from -> to, radius from -> to, ...), compares the
block definitions when both revisions are DXF files or the headless current
document, and groups the changes into clusters.
Read-only unless markup=True: then revision clouds are drawn around the
model-space clusters on the current document, which must be the newer
revision, and filed as one revision row - the only write this tool makes.
Refused before anything is read: markup=True with new_path (the clouds go
on the current document), markup=True without a valid rev, markup=True
on an engine without the revcloud capability (the live engine -
capability: "revcloud"), a path that does not exist, a DXF over
MAX_DXF_BYTES (the size and the variable named), a file that is not a
readable DXF, and a non-positive tol or move_tol.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rev | No | Revision code for markup=True: one to three capitals or digits. | |
| tol | No | Geometry is compared rounded to this many drawing units. | |
| limit | No | Rows kept per list (changed, added, removed). | |
| markup | No | Draw revision clouds around every cluster of change on the current document (the newer revision) and file them under `rev`. | |
| move_tol | No | An unmatched entity is paired with the nearest one of its type and layer within this distance and reported as changed; default 2 % of the drawing's robust diagonal. | |
| new_path | No | The NEWER revision: a DXF path, or omitted for the current document. | |
| old_path | Yes | The OLDER revision: a DXF path (a DWG only on the live engine, which exports it read-only). | |
| description | No | Revision-row text for markup=True; default: the counts. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||