• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
blog.draftsperson.net

blog.draftsperson.net

the art of technical drawing

blog.draftsperson.net

ATTSQUEEZE LISP: Set Attribute Width Factor by Dragging

August 3, 2026

A long project name in a fixed-width title block box is a familiar problem, and the usual fix is guessing at width factors in the Properties palette and re-checking after each guess. ATTSQUEEZE lets you drag until it fits, with the value shown live at the cursor, and click.

What AttSqueeze does

Pick a single-line attribute and move the cursor. The width factor follows, the text squeezes or stretches in real time, and the current value is displayed at the cursor as you go. Click to accept.

The point is to stop iterating. You are looking at the box the text has to fit inside, so drag until it fits — no arithmetic, no guess-and-check cycle through a palette.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type ATTSQUEEZE.
  3. Pick the attribute to adjust. Multiline attributes are refused at selection, with an explanation.
  4. Move the cursor to set the width factor. The live value follows it.
  5. Click to accept.

How it works

The controls while dragging:

Move the cursor — sets the width factor.
TAB — switch between continuous and stepped adjustment.
I — set the step size, in stepped mode.
R — reset to the width factor of the block’s attribute definition, that is, back to how the block was designed.
C or Escape — cancel, restoring the original width.
Click — accept.

The mode and step size are remembered between AutoCAD sessions, so an office that always works in steps of 0.05 sets it once.

How the drag is calculated. The cursor’s displacement from the attribute’s base point is projected onto the attribute’s own text direction. That gives a distance along the text regardless of which way the cursor actually moved — so dragging diagonally still reads as a sensible squeeze rather than jumping about. That distance is divided by the text’s width at factor 1, measured once at the start, to give the factor.

Because the direction vector comes from the attribute’s own rotation, this works at any angle and in any construction plane. Rotated title blocks and attributes on a UCS behave the same as horizontal ones.

Width factors are constrained to between 0.01 and 100, which is the range AutoCAD itself accepts. Outside it the cursor readout turns red and no change is applied — you can see you have gone too far before you click, rather than being told afterwards.

Notes and limits

  • Single-line attributes only. A multiline attribute has no width factor — it wraps instead — so those are refused at selection with an explanation rather than failing silently.
  • Width factor is not the same as squeezing the box. This changes the text, not the block geometry around it.
  • R resets to the definition, not to whatever the value was when you started. Escape does that.
  • One undo group, so a single U restores the original width.

Download and details

NameAttSqueeze — set an attribute’s width factor by dragging
DownloadAttSqueeze.lsp — 33.5 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandATTSQUEEZE
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com).
Source size33.5 KB, 625 lines
Error handlingYes — a *error* handler restores every system variable it changed, on cancel as well as on error.
UndoThe whole operation is wrapped in a single undo group, so one U reverses all of it.
CompatibilityAutoCAD (any release with AutoLISP), BricsCAD, ZWCAD, GstarCAD, ProgeCAD and other IntelliCAD-based platforms. AutoCAD LT needs a LISP enabler. No .NET, no ObjectARX, no installer.
AuthorYZ, August 2026
LicenceFree to use, supplied “as is” with no warranty.

References

  • ATTCLONE LISP — copy the finished formatting onto every other attribute
  • Text heights in drawings — the height the width factor is working against
  • More free AutoLISP routines on this site
  • Wisey’s Steel Shapes — free structural steel section drawing program

Filed Under: AutoLISP Routines

Primary Sidebar

Subscribe to our Youtube Channel

Post CAD drafting jobs on Freelancer.com. and get some free money to do this.

Categories

  • American Steel Industry (4)
  • AutoCAD Articles & Reference (30)
  • AutoCAD Bugs & Problems (19)
  • AutoCAD Tips (29)
  • AutoCAD Tutorials (54)
  • AutoLISP Routines (328)
  • AutoLISP Tutorials (15)
  • CAD Standards (7)
  • Civil 3D (7)
  • Civil Drafting (4)
  • Dimensions (2)
  • Drafting Funnies (71)
  • Drafting History (9)
  • Drafting Standards (84)
  • Electrical Drafting (2)
  • General IT reference (7)
  • Geometry (15)
  • GIS (2)
  • Hatch Patterns (12)
  • Office Life Hacks (3)
  • PT (1)
  • Revit Tutorials (54)
  • Steel Detailing (14)
  • Structural Drafting (26)
  • Technical Dictionary (61)
  • Useful Website Links (19)

Footer

Free downloads

  • Free AutoLISP routines
  • Free hatch patterns
  • SHX fonts & text styles
  • Numbering LISP collection
  • ISO 3098B font

Reference charts

  • AWS weld symbols chart
  • Steel detailing chart
  • Hole & slot sizes
  • Bolt edge distance
  • ANSI & ARCH paper sizes
  • How to fold an A1 drawing

Useful links

  • CAD blocks (DWG)
  • Revit families
  • structuraldrafter.com
  • cad-corner.com
  • About
  • Privacy policy

Provided for free with no warranty · Log in