• 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

MLAYER LISP: Move Every Object on an AutoCAD Layer

September 19, 2020

Last updated July 28, 2026

MLAYER moves everything on a layer. Type the layer name, and every object on it — wherever it is in the drawing — is gathered up and handed to the MOVE command for you to place.

It is by Paul Standing, dated 1995, and he also wrote the three-tangent circle and double offset routines on this site.

Selecting by layer, not by window

The point of it is the selection, not the move. Windowing a layer’s worth of objects means either isolating the layer first or picking carefully around everything else, and either way you will miss whatever is off screen.

This searches the whole drawing database by layer name, so it finds everything — including objects on parts of the drawing you are not looking at. That is genuinely useful when a whole layer has been drawn in the wrong place and needs shifting as a unit.

It also means you should be sure of the layer name before you commit. There is no confirmation and no report of how many objects were found, so a typo gives you an empty selection and a slightly confusing MOVE prompt rather than a clear error.

Note that a database-wide search does not respect layouts. If the layer has objects in both model space and a paper space layout, both will be caught up in the same move, which is almost certainly not what you want. Check before running it on a drawing with populated layouts.

It hands the move back to you

The routine does not ask you where to move things. It starts the MOVE command with the selection already made and then steps out of the way, so you complete the move exactly as you would normally — base point, then destination, with all the usual snaps and coordinate entry available.

That is a sensible division of labour: the routine does the part AutoCAD makes awkward, and leaves the part AutoCAD already does well alone.

One consequence worth knowing: because the routine finishes while the MOVE command is still waiting for you, it restores command echo partway through your move rather than at the end. Harmless, but it explains why the command line may look busier than you expected.

Command reference

The file defines a single command, MLAYER.

Note that AutoCAD has an MLAYER-ish family of layer commands of its own in Express Tools, and the LLP Suite here defines a great many layer commands too. Check for a clash before loading if you have either.

How to load it

Unzip Mlayer.zip and load MLAYER.LSP with APPLOAD. No support files. Our AutoLISP guide covers loading.

Step-by-step usage

  1. Save first. This moves objects you cannot see, which makes checking the result harder than usual.
  2. Type MLAYER.
  3. At “ENTER LAYER TO MOVE:” type the layer name exactly. Case does not matter but spelling does.
  4. The MOVE command starts with everything selected. Give it a base point and a destination as normal.
  5. Zoom to extents afterwards to confirm nothing unexpected came along.

Compatibility notes

1995, so written-for rather than tested-on. It builds a selection set by layer and drives MOVE, neither of which has changed, so it stands a reasonable chance on a current release.

Plain AutoLISP with no dialog boxes and no Express Tools calls, so nothing requires the full product; LT users on LT 2024 or later, the release that brought AutoLISP to LT, should be able to run it. See what runs on AutoCAD LT. It moves geometry, so work on a copy the first time.

Download

Name: MLAYER
Description: Move layer will move an entire layer as your selection set.
Type: AutoCAD AutoLISP Routine
Author: Paul Standing
File Size: 1 Kb
Cost: Free
Worked on: AutoCAD
Download File: Mlayer.zip

Related routines

  • Layer Tool — includes a Move option driven by picking rather than typing.
  • Delete Layer — the same select-by-layer idea, aimed at removal.
  • LayerMatch — find the layer name by picking an object first.

References

  • AutoLISP: the complete guide
  • Free LISP routines library
  • AutoLISP on AutoCAD LT

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