Aligning text labels, room tags, or block symbols along angled walls, grids, or mechanical pipes in AutoCAD can be time-consuming. Using the native ROTATE command often spins objects away from their original insertion centers, while updating angles manually via the Properties palette (CTRL+1) requires clicking through entities one by one.
The ZAA.lsp (Zero Angle Adjuster) utility lets you batch-update rotation angles for Text, MText, and Blocks while keeping their insertion base points completely stationary. You can type an absolute angle value, reuse your last entered angle, or pick an existing reference object on screen to match its rotation angle instantly.
Key Workflow Advantages
Fixed Insertion Point Rotation: Updates rotation properties while holding entity base points stationary, preventing objects from spinning out of place.
Match Angle from Reference (
Copy): TypeCto click any reference text or block on screen and copy its exact orientation angle.Batch Selection Support: Modifies Single-line Text, MText, and Block insertions simultaneously across a single crossing window.
Persistent Angle Memory: Stores your previously applied angle value so you can reapply it continuously with a single press of Enter.
Step-by-Step Instructions
Load
ZAA.lspinto AutoCAD using theAPPLOADcommand.Type
ZAAin the command prompt and hit Enter.Set your target rotation angle:
Enter a numerical angle value (e.g.,
45) and press Enter.Press Enter directly to reuse your previously saved angle.
Type
C(orCopy), press Enter, and click a reference text/block on your screen to copy its angle.
Select all target Text, MText, or Block objects.
Press Enter to confirm. All selected entities will instantly align to the specified angle.
AutoLISP Code (ZAA.lsp)
Copy the code below and save it as ZAA.lsp inside your AutoCAD support folder:
(defun c:ZAA ( / *error* doc old_osmode old_cmdecho ss i ent dxf exact_ang ref_ent ref_dxf input )
(vl-load-com)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(defun *error* (msg)
(if old_osmode (setvar "OSMODE" old_osmode))
(if old_cmdecho (setvar "CMDECHO" old_cmdecho))
(if doc (vla-endundomark doc))
(princ "\nCAD Lisp [www.daolpro.com]")
(princ)
)
(setq old_osmode (getvar "OSMODE"))
(setq old_cmdecho (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(vla-endundomark doc)
(vla-startundomark doc)
(if (null *global_saved_angle*)
(setq *global_saved_angle* 0.0)
)
(initget "Copy")
(setq input (getangle (strcat "\nSpecify absolute UCS angle or [Copy angle from object] <" (angtos *global_saved_angle* 0 2) ">: ")))
(cond
((= input "Copy")
(setq ref_ent (car (entsel "\nSelect source object to copy absolute angle from: ")))
(if ref_ent
(progn
(setq ref_dxf (entget ref_ent))
(if (assoc 50 ref_dxf)
(progn
(setq exact_ang (cdr (assoc 50 ref_dxf)))
(setq *global_saved_angle* exact_ang)
)
(progn
(princ "\nSelected object does not have an angle property.")
(setq exact_ang nil)
)
)
)
)
)
((null input)
(setq exact_ang *global_saved_angle*)
)
(t
(setq exact_ang input)
(setq *global_saved_angle* exact_ang)
)
)
(if exact_ang
(progn
(prompt "\nSelect text or blocks to set absolute angle: ")
(setq ss (ssget '((0 . "TEXT,MTEXT,INSERT"))))
(if ss
(progn
(setq i 0)
(while (< i (sslength ss))
(setq ent (ssname ss i))
(setq dxf (entget ent))
(if (assoc 50 dxf)
(setq dxf (subst (cons 50 exact_ang) (assoc 50 dxf) dxf))
(setq dxf (append dxf (list (cons 50 exact_ang))))
)
(entmod dxf)
(entupd ent)
(setq i (1+ i))
)
)
)
)
)
(setvar "OSMODE" old_osmode)
(setvar "CMDECHO" old_cmdecho)
(vla-endundomark doc)
(princ "\nCAD Lisp [www.daolpro.com]")
(princ)
)
Annotation Efficiency Tip
When labeling complex site plans or architectural elevations with angled grid lines, use the Copy mode (ZAA > C) to sample grid angles directly, ensuring perfect parallel alignment across all drawing callouts.

Post a Comment