A consultant sends you a floor plan with dozens of layers. You want to use it in your own AutoCAD drawing, but you need everything on one layer and in one color. Doing it by hand is slow, and it never works the first time.
In this article I show why the manual way breaks, and the first steps to build a one-click AutoCAD tool that does it for you.
Why merging layers by hand does not work well
The manual way is to create a new layer, select everything, and then right click a layer in the Layer palette and choose Merge. It works, but it is tedious. AutoCAD also warns you that some layers will not change, because some layers have overridden colors or linetypes. Those objects stay as they were.
That is why I prefer a small custom command. In AutoCAD it is called a macro: a series of commands put together and run with one click. You build it in the Tool Palette. Drag any object onto the palette, right click it, open Properties, and type your command in the Command string field.
How to change everything to one layer with CHPROP
The core of the macro is the CHPROP command (change properties). Start the string with ^C^C so it cancels any running command first. Then use _.chprop and answer the questions the command line asks: select all, press Enter, choose Layer, and type the layer name.
If you test it and some objects do not change, check for locked layers. CHPROP skips objects on locked layers. So before CHPROP, add the -layer command (with the dash, so it uses the command line and not a dialog box) to turn on, thaw and unlock all layers with an asterisk.
One more tip: create the target layer first, with -layer and the New option, then use that same name inside CHPROP. Order matters in a macro.
The fastest way: watch me do it
This is only half of the tool. In the livestream I finish it live and show you how to fix the problems that appear:
- Objects that still show the wrong color because of overrides
- Keeping your north arrow and details untouched, by choosing what gets changed
- Picking any color you want with one number
I also show how I find the error when a macro stops halfway. Watch the video below to see the complete macro working.
Watch the full livestream
I show every step live in this video: AutoCAD Layer Nightmare? Merge All Layers Into One. If it saved you some time, subscribe to Lazy Arquitecto on YouTube, and join me live every Sunday at 11 AM for a new LazyTask, where I answer your AutoCAD questions in real time.
