• 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

MLSHIFT LISP: Change Multiline Justification in Place

August 3, 2026

MLSHIFT changes the justification of multilines without moving them. It is the multiline equivalent of the Express Tools TJUST command, which does the same job for text.

What MlineShift does

The problem it solves. An mline’s justification says which of its element lines sits on the path you drew. Change it the obvious way, by editing the property, and the whole multiline jumps sideways — because the path stays put and the elements move relative to it. A wall drawn to its centreline suddenly stands off by half its thickness.

This routine changes the justification and simultaneously shifts the path by the exact compensating offset, so the multiline does not appear to move at all. What changes is which line the geometry is now measured from — which is what you actually wanted.

How to use it

  1. Load the routine with APPLOAD, or put it on your support file search path.
  2. Type MLSHIFT.
  3. Select the multilines.
  4. Choose the new justification. The geometry stays exactly where it is.

How it works

Every mline style defines its element lines as offsets from the path, held as DXF group 49 values in the style dictionary. The largest is the top element, the smallest the bottom. The distance the path must move is the difference between the old justification’s reference offset and the new one’s, multiplied by the mline’s own scale factor.

That shift is applied along the mitre direction at each vertex, not square to the path — which is what keeps mitred corners closed. The sine term in the calculation accounts for the mitre angle.

Move the vertices perpendicular to the path instead and every corner opens up by an amount that depends on its angle, which is the failure that makes this look easy and turn out not to be.

Works in any UCS, with any mline style and any mline scale.

Notes and limits

  • The geometry does not move; the reference line changes. That is the whole point, and it is the opposite of what editing the property does.
  • Mitred corners stay closed, because the shift follows the mitre direction.
  • It reads the style’s element offsets, so it works with custom mline styles, not just the standard one.
  • One undo group covers the whole selection.

Download and details

NameMlineShift — change multiline justification without the geometry moving
DownloadMlineShift.lsp — 11.0 KB, plain AutoLISP source. Downloads directly; no zip to unpack.
TypeAutoCAD AutoLISP routine
CommandMLSHIFT
Requiresthe ActiveX layer (loaded automatically by the routine with vl-load-com).
Source size11.0 KB, 266 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

  • DTWALL LISP — a wall layer dialog for drawing floor plans
  • PARTOFFSET LISP — offsetting only part of a polyline
  • 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