How to merge layers ?

How to merge layers ?

Angayo
Advocate Advocate
15,006 Views
15 Replies
Message 1 of 16

How to merge layers ?

Angayo
Advocate
Advocate

I would like reduce the number of layers of a drawing to as few as possible, preferably one. There is the function merge layers that sometimes work. However, how can one merge layers when that fails ?

 

There are of course the problem layers like active, locked, frozen, XREF, 0 and defpoints, but how can I merge to other ones ?

0 Likes
Accepted solutions (1)
15,007 Views
15 Replies
Replies (15)
Message 2 of 16

pendean
Community Legend
Community Legend
Are you trying to manage ACA aec-specific layers, or are you just talking "plain AutoCAD" layers? This is not the forum for "plain AutoCAD".

When layer B fails to merge with layer A, can Layer A be merged with layer B instead? You can always rename the layer after the fact.
0 Likes
Message 3 of 16

Angayo
Advocate
Advocate

I have Autocad Architecture and I am not familiar with aec-specific layers.

 

I tried to merge two layers into each other and neither attempt worked. In the command window the message ‘Unknown command “Y”. Press F1 for help.’ appeared.

0 Likes
Message 4 of 16

leothebuilder
Advisor
Advisor

Try the LAYMRG command, and see the command prompt for options.

0 Likes
Message 5 of 16

Angayo
Advocate
Advocate

Typing laymrg prompts the prompt :

“Select objects on layer to merge or [Name]:”

If I type ‘Name’ and Enter I get a ‘Merge Layers’ dialog box with a list of most layers. Selecting a few and pressing OK makes the command prompt list the selected layers. Nothing more.

0 Likes
Message 6 of 16

pendean
Community Legend
Community Legend

What method are you using exactly? I don't think it's what you have subsequently typed.
"unknown command Y" usually means you are using a customization that has a code flaw in it.

0 Likes
Message 7 of 16

leothebuilder
Advisor
Advisor

At the prompt enter LAYMERGE.

Now select the layers you want to merge (the layers you want to get rid of) by clicking on entities on those layers. (linework for example) 

Once you selected all those layers, hit enter and at the next prompt select the layer you want to merge to (destination layer) by clicking

on an entity that resides on that layer.

Hit enter again and you will get a message if you want to proceed with this or not, select yes and hit enter key.

0 Likes
Message 8 of 16

Angayo
Advocate
Advocate

@ pendean :

As far as I know I am not using any method exactly and as far as I know I am not using a customization with a code flaw in it.

 

If I use the procedure described in the help under ‘Merge Layers in the Layer Properties Manager’, after having selected the target layer, the command prompt says : “-LAYMRG select object on layer to merge or [Name Undo]:”

 

@ leothebuilder :

I drew a line in one of the to merge layers (0_axes) and another in the target layer (XREF).

 

Autocad is not familiar with the command laymerge, so I tried laymrg in stead.

Then the command prompt said : “Select objects to merge or [Name]:”

So I click the line I drew in the layer 0_axes.

The line is not selected, but the command prompt says : “Selected layers: 0_axes”

So I click my line from the XREF layer. It is selected. Nothing has merged.

0 Likes
Message 9 of 16

pendean
Community Legend
Community Legend
LAYMRG is the command name, correct.
Instead of selecting an object, type in the layer names you wish to merge together.

if you cannot figure it out, you need to pose your DWG file and identify the two or more layers you are trying to merge for someone else to try.
0 Likes
Message 10 of 16

leothebuilder
Advisor
Advisor

Sorry for the typo

 

Maybe this video will help:

 

https://www.youtube.com/watch?v=aFDmqtoU7FY

 

And depending on which version of Autocad you have you can also merge layers in the Layer Manager.

 

In the Layer Manager select all the laters you want to merge (use the CTRL key) and right click.

On the menu scroll down about halfway and you will see "Merge selected layer(s) to".

Select the layer you want to merge.

0 Likes
Message 11 of 16

Angayo
Advocate
Advocate

@ pendean :

I thought I had tried typing a layer name before and remember getting the list of allegedly selected layers, but this time te command prompt gives the response :

“”Invalid selection”

Expects a point  or Last/Name]:

LAYMRG Select object on layer to merge or [Name]:”

 

@ leothebuilder :

I have Autocad Architecture  2016.

Thanks, but the video fails to explain how to merge layers when laymrg doesn’t work. The same holds for your explanation.

 

I have added the file as attachment.

0 Likes
Message 12 of 16

leothebuilder
Advisor
Advisor
Accepted solution

I opened your file and you were correct, the LAYMRG command and the layer merge in the Layer Manager did not work.

 

After I ran the AUDIT command and selected "yes" to fix any errors, both merge methods worked fine.

 

So on your drawing file run the AUDIT command to fix errors.

 

Plezierige dag gewenst.

Message 13 of 16

Angayo
Advocate
Advocate

Thanks, audit seems to have done the trick. I thought I had already audited though. I also managed to get rid of layers in other XREFs. Purge also seems to delete layers sometimes.

Why does the help not mention that ?

0 Likes
Message 14 of 16

leothebuilder
Advisor
Advisor

Help will and can only do so much.

 

When a command fails, or does not produce the expected result try and isolate the problem.

If I encounter a problem I always try whatever I am trying to accomplish in another file to see if the same problem occurs.

Sometimes I even try in a new file.

That way you can isolate the problem to either a file problem or a software problem.

 

0 Likes
Message 15 of 16

gerardobarria
Community Visitor
Community Visitor

Try using wblock for entire drawing. Have a nice day.

0 Likes
Message 16 of 16

d_salesU937X
Contributor
Contributor

@leothebuilder Thank you very much for this - I too was suddenly getting unknown command -"Y" when trying to merge - I do it through the Layer Property menu and right clicking so couldn't be making any error. However running the AUDIT command like you suggested has solved it.

0 Likes