Categories

AutoCAD 2015 and AutoCAD LT 2015 Bible

The most comprehensive AutoCAD book around!

How to merge layers in AutoCAD–move objects to another layer and delete the merged layer

You may have objects on the wrong layer–in fact, you may not want to even keep the layer those objects are on. The solution is the LAYMRG command. This is a guest post by Will Forty, who has a great blog called HowToAutoCAD.com.

He writes:

“I was recently asked if there was a quick way to put all the objects on a certain layer onto another layer, which reminded me of this little beauty that you need to know about.

LAYMRG is a command for manipulating layers in AutoCAD, and gives you the facility to merge two or more layers together so that the objects end up on the final target layer that you choose. The old layers that now contain no objects are removed, effectively merging the layers. Precisely what you’d expect from a command named LAYMRG.

Whilst this feature alone is very useful, this command can also be really helpful for getting rid of unwanted layers in your drawing. This has happened to all of us – you’re working away and there’s a layer in the drawing that refuses to allow you to delete it! Probably this is because it’s used within a block, or perhaps a block within a block, and it can be a real nightmare trying to identify where the offending object is that is using it.

A workaround to the problem is to just merge it with, say, layer 0, so that you get rid of the offending layer, and whatever was using it now is on Layer 0.

So that’s my piece for today – LAYMRG, a really useful tool you should remember!”

I just wanted to add the prompts:

At the Select object on layer to merge or [Name/Undo]: prompt, select an object on the layer that you want to delete. All objects on that layer will move to the layer you’ll specify next. The prompt repeats, so press Enter to continue.

At the Select object on target layer or [Name]: prompt, select an object on the layer that you want to merge to. All objects on the first layer will now be on this target layer.

You’ll need to confirm the change.

Will Forty’s HowToAutoCAD blog aims to show you “How to use, customise and ultimately master AutoCAD.” I suggest that you browse through the posts. If you find it valuable, you can subscribe to get e-mail updates when he publishes a new post.

Ellen Finkelstein

16 comments to How to merge layers in AutoCAD–move objects to another layer and delete the merged layer

  • MOHD

    OK
    but I just ask if there is a way to use keyboard inspit of mouse to get an order like draw,trim,ortho….etc,So I can do my work quickly.

    Best Regards

  • James Donaldson

    In 2012 when I use the name option AutoCAD pops up a window with a list of layers names in the drawing. But 0 is not one of the layers! Wills suggestion on ways to clean up lauers especially in blocks is great but How would you automate this if you have to pick something drawn on layer zero?

  • NGB

    Hello, My question is very similar to the last. I’m using 2012 LT.
    In our template file there are two layers marked as in use: 0, obviously, and POINTS. We don’t want points.
    Because there’s nothing visible on POINTS, when I try LAYMRG there’s nothing to select. I key in N and then scroll through the layers to select POINTS. It accepts it but then the command line asks again to select the “object on layer to merge or [Name/Undo}:” There is no following request to choose 0 as the target layer even if it came up in the scroll down window for layer selections.
    Hope you can help.
    Thanks.

  • elyass_smh

    Thank you
    very useful command!!!!

  • Goran H

    Thank you for solving another of my problems.

  • IB

    I use a lot LAYMRG but just now I am have ing a problem with this command. It simply does not do merging. Is there a restriction or conditions when the command does not work?

  • Nathan

    @ NGB

    (Hello, My question is very similar to the last. I’m using 2012 LT.
    In our template file there are two layers marked as in use: 0, obviously, and POINTS. We don’t want points.
    Because there’s nothing visible on POINTS, when I try LAYMRG there’s nothing to select. I key in N and then scroll through the layers to select POINTS. It accepts it but then the command line asks again to select the “object on layer to merge or [Name/Undo}:” There is no following request to choose 0 as the target layer even if it came up in the scroll down window for layer selections.
    Hope you can help.
    Thanks.)

    I had the exact same thing happen to me.

  • Ellen

    Sorry, I don’t have LT to test it.
    Do you mean DEFPOINTS? Have you tried deleting the layer, rather than trying to merge it?

  • Justin

    You cannot delete layer 0 because it is embedded in Autocad just as Defpoints. It has a very specific use. So leave it. Defpoints will not print by default. Layer 0 is used inside blocks. If you have something in a block on layer 0, whatever layer you put the block on, the 0 layer inside the block will assume those properties. If you cant find whats going on with a layer, use the layiso command to pinpoint trouble spots and change the layers before you purge or delete. If a layer you are trying to delete or merge has something inside a block. open the block and change its layer.

  • Mark Wales

    Answer to NGB on April 25, 2012:
    What I do is create a line on layer Points.
    That gives me something to select when using LAYMRG.
    Then delete the line after merging.

  • Jesse

    I do not want all the layers on one layer,which is what happened to me accidently. So I want to un-do the merge command, which I may have clicked on purely by accident. i also suspect there is a setting that is wrong but I don’t know which one it could be. i mailed a copy of the drawing to a friend and he had no problem with layers at all,they were not merged together and they all were on their separate layers. So that says something in this drawing is set wrong but what?This drawing is done using 2009 Autocad.

  • David Ward

    Just an FYI, Defpoints is an AutoCad created layer that is tied to 0 layer. Defpoints is used by dims and is the point at which you are measuring to and from. it is created when you place a dimension. By default it is non-plot and can’t be changed. If you freeze Defpoints you will find it impossible to select objects on the 0 layer. I used to use defpoints to put my viewports on, this is how I discovered the relationship it has with 0 layer. I no longer place anything on the 0 layer or defpoints. I use a layer called vport, color 8 and make it non-plot, the name can be whatever you want as well as the color. I chose 8 because it is a dark grey and lets you see it with out it being right in your face.

  • I really liked your content, thank you I’m always following

  • Jason

    This is a nice command but wish I could find a way to use this for VBA; been researching for a week now and can’t find anything that will work for blocks that have layers nested inside.

    One thing I found with the merge command, you can’t have ANY locked layers.

  • jeya

    I use a lot LAYMRG but just now I am have ing a problem with this command. It simply does not do merging.
    Selected layers: C-ANNOTATE1.
    Select object on layer to merge or [Name/Undo]:

    Select object on target layer or [Name]:

    Enter layer name or [?]:
    Regenerating model.

    Command:
    Command:
    Unknown command “Y”. Press F1 for help.

    Command: _u -LAYMRG GROUP LAYER

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>