Last updated July 28, 2026
LayerMatch sets the current layer to match something you point at. Click any object and the layer it sits on becomes current — or type a layer name instead if you would rather. It is the small operation that sits behind half the layer fiddling in a working day: you are about to draw something that belongs with that, so make that layer current.
It is by Charles Alan Butler, version 1.0, dated 12 December 2005.
The listing has the wrong name on it
Worth clearing up before anything else. The download table below calls this “Line Then Text”, which is a different routine entirely — the name has been attached to the wrong entry at some point in the last twenty years. The description in the same table is correct.
What you get is LayerMatch. The file is layermatch.lsp, the command is LAYERMATCH, and it matches layers. Nothing in the download draws a line and then some text.
One prompt, two ways to answer
The clever part is the prompt, which accepts either a pick or typed text and works out which you gave it. Click an object and it reads that object’s layer; type a name and it uses that. One prompt, no mode switch, no second command for the typed case.
It also uses the nested form of object selection, which means it will read the layer of an object inside a block or an xref rather than reporting the layer the block sits on. That is usually what you want when you are pointing at something and thinking “that layer” — you mean the layer of the thing you can see, not its container.
The routine loops until it gets an answer it can use, so a miss re-prompts rather than dropping out and making you retype the command.
How it compares to what AutoCAD already has
Full AutoCAD has shipped a layer-matching command in Express Tools for many years, and current releases have layer tools built in. If you have those, you may not need this.
Where it earns its place is AutoCAD LT. Express Tools have never been part of LT, and LT did not gain AutoLISP at all until LT 2024 — so for LT users on 2024 or later this is a way to get the behaviour at all. It is plain AutoLISP with no dialog boxes, so there is nothing in it that LT cannot run.
Command reference
The file defines a single command, LAYERMATCH. That is a long name for something you will use constantly, so it is a good candidate for a two or three letter alias in your PGP file.
How to load it
Unzip Layermatch.zip and load layermatch.lsp with APPLOAD, or put it in the Startup Suite — a command this small only saves time if it is always there. No support files. Our AutoLISP guide covers loading.
Step-by-step usage
- Type LAYERMATCH.
- At “For layer select entity or enter layer name:” either click an object or type a layer name.
- That layer becomes current. Draw.
Remember that clicking something inside a block gives you the layer of that internal object, not the block’s own layer. If you want the block’s layer, click a block that sits on it in isolation, or type the name.
Compatibility notes
2005, which makes it one of the more recent routines in this library. It uses standard selection and entity functions that have not changed since, so it stands a good chance on a current release.
No dialog boxes and no Express Tools calls, so nothing requires the full product — see what runs on AutoCAD LT. It changes a setting rather than any geometry, so there is nothing at risk in trying it.
Download
| Name: | Line Then Text |
| Description: | Match Layer Property, Select or enter layer name. |
| Type: | AutoCAD AutoLISP Routine |
| Author: | Charles Butler |
| File Size: | 2 Kb |
| Cost: | Free |
| Worked on: | AutoCAD |
| Download File: | Layermatch.zip |
The Name row above is the mislabelling described at the top of this page. The download itself is LayerMatch.
Related routines
- Delete Layer — the other end of layer housekeeping.
- LLP Suite — a large set of layer commands with toolbars.
- UPDBLOCK — fix the layers inside blocks.