Cannot delete layer, contains objects in block definition

Cannot delete layer, contains objects in block definition

twhitwell6
Enthusiast Enthusiast
21,773 Views
19 Replies
Message 1 of 20

Cannot delete layer, contains objects in block definition

twhitwell6
Enthusiast
Enthusiast

Good Morning All, 

 

Been having this issue quite a lot recently copying work from one file to another. 

 

I try and delete a layer and it comes up with the dialogue box: " The selected layer(s) contain objects from one or more block definitions and cannot be deleted. In the Block Editor (bedit), move the objects to a different layer and try again"

 

Unfortunately without going through every single block in block edit (and im sure theres they are all on layer 0), I cant see a quick way to find what objects these are or what block they are part of. 

 

Does anyone have a quick solution to this one. Im sure many people have had this problem before. 

 

Thanks 

0 Likes
Accepted solutions (2)
21,774 Views
19 Replies
Replies (19)
Message 2 of 20

rkmcswain
Mentor
Mentor
Try using the LAYMRG command to merge the layer you want to delete, onto layer 0.

Ref: http://help.autodesk.com/view/ACDMAC/2017/ENU/?guid=GUID-7D66940F-EC67-4DEC-89BC-82B887EABD6E






R.K. McSwain     | CADpanacea | on twitter
Message 3 of 20

twhitwell6
Enthusiast
Enthusiast

There isnt a LAYMRG command. 

 

Im using AutoCAD for MAC 2015

0 Likes
Message 4 of 20

rkmcswain
Mentor
Mentor
That is strange, the AutoCAD for Mac 2015 documentation includes this command. Any thoughts @john.vellek ? Docs wrong?
R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 5 of 20

twhitwell6
Enthusiast
Enthusiast

We missing the - at the beginning. The command is -LAYMRG. 

 

once Ive entered this command though, it asks to select objects on layer to merge. 

 

The problem Im having is that there shouldnt be any objects on the layer im trying to delete. But its saying that there are some objects that are part of a block definition on this layer. Im trying to find out what these objects are. 

 

Am I making sense? Im not great at explainng things.  

0 Likes
Message 6 of 20

maxim_k
Consultant
Consultant
Accepted solution
Draw something on layer you want to delete (temporary) and pick on that object when AutoCAD will ask about layer to merge or use "Name" option to type the name of the layer you want to merge.

Maxim

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
Message 7 of 20

maxim_k
Consultant
Consultant
There is another thing with -LAYMRG command in AutoCAD for Mac. It has a bug: objects you move to another layer and are inside block definitions, moved "nowhere": if you will open block with such objects in Block Editor and look at their properties, you will see "Multiple selected" in Layer property. If you will run AUDIT command in the drawing after using -LAYMRG command you will notice errors, if those errors will be repaired, objects inside block moved to another layer will be placed on $AUDIT-BAD-LAYER layer.

Maxim

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
Message 8 of 20

rkmcswain
Mentor
Mentor
@maxim_k - there is a similar bug when using this command in Civil 3D, and the layer you are merging/deleting is in a C3D style. When you go to view that style later, the layer will be empty, and an AUDIT will "fix" it and set all of the empty layers to layer "0".
R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 9 of 20

rkmcswain
Mentor
Mentor
twhitwell6 wrote:

We missing the - at the beginning. The command is -LAYMRG. 

Apologies - sometimes in the forums, if you are too explicit, the other person may feel like they are being talked down to. Other times, if you assume the user knows about details (such as the "-" prefix in this case), you are not giving enough details. Glad you got it to work.

R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 10 of 20

john.vellek
Alumni
Alumni
Accepted solution

Hi @twhitwell6,

 

I no longer have 2015 installed but I opened up a drawing in AutoCAD for Mac 2016. When I type LAYMRG it automatically executes -LAYMRG.  I find the command line driven feature useful but I prefer to use the combine layers feature.  To use this, open your Layer Properties Manager, select the desired layer and then rt-click. Select the 'Combine with  layer' and you will see a window open that displays the available layer to combine.

 

Screen Shot 2018-02-15 at 8.37.05 AM.png

Please select the Accept as Solution button if my post solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
Message 11 of 20

Johanna_Esteban
Advisor
Advisor

Hello @twhitwell6

 

Although the issue is solved, there is a way to remove a layer even if it contains elements.


If you are sure of the name of the layer or you know you have an element in it and you want to delete it in all the forms, use LAYDEL; you can select a object in the layer to be deleted or, choose option NAME and in the window you select it, then it will ask you to confirm and it is ready! I will not leave remnants that you have to purge in that layer.

 

Regards,

 

 

Postponed:
It works even with difficult layers like ASHADE or DEFPOINTS.



Johanna Esteban

EESignature


Autodesk Expert Elite | Autodesk Certified Professional | AutoCAD Customer Council (Beta Tester for Windows & Mac)

¿Te ha parecido útil este post? ¡Dame Kudos! 😉
Si ha sido resuelta tu inquietud, selecciona 'Marcar como solución' para que otros usuarios la encuentren fácilmente.

Message 12 of 20

john.vellek
Alumni
Alumni

Hi @Johanna_Esteban,

 

I don't believe the LAYDEL command works in AutoCAD for Mac however there is a delete ability in the Layer Properties Manager as shown in my screenshot in my previous post.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 13 of 20

maxim_k
Consultant
Consultant
I'm afraid, LAYDEL cannot delete layer from the drawing if some of the objects inside Block definition resides on this layer. Even if that Block is not inserted anywhere in the drawing.

Maxim

Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes
Message 14 of 20

Johanna_Esteban
Advisor
Advisor

Dear @john.vellek

 

Right now I do not have Autocad mac in my hands, but I see in the capture of your post you have the layer ashade and defpoints, how about you test for me now and tell me? Pleaseee


I can not wait to check it.

 

Greetings.



Johanna Esteban

EESignature


Autodesk Expert Elite | Autodesk Certified Professional | AutoCAD Customer Council (Beta Tester for Windows & Mac)

¿Te ha parecido útil este post? ¡Dame Kudos! 😉
Si ha sido resuelta tu inquietud, selecciona 'Marcar como solución' para que otros usuarios la encuentren fácilmente.

0 Likes
Message 15 of 20

Johanna_Esteban
Advisor
Advisor

Hello @john.vellek

 

This is a file that has been exported from 3d max to dwg, and always brings with it the ashade layer.

Thank you!



Johanna Esteban

EESignature


Autodesk Expert Elite | Autodesk Certified Professional | AutoCAD Customer Council (Beta Tester for Windows & Mac)

¿Te ha parecido útil este post? ¡Dame Kudos! 😉
Si ha sido resuelta tu inquietud, selecciona 'Marcar como solución' para que otros usuarios la encuentren fácilmente.

0 Likes
Message 16 of 20

john.vellek
Alumni
Alumni

Hi @Johanna_Esteban,

 

Thanks for the file!

 

I tested it in both AutoCAD 2018 for Windows and AutoCAD 2018 for Mac.  Both applications would not let me directly delete the layer but both allowed me to Merge (Windows) or Combine (Mac) to layer 0 and then removed the layer from my layer list.

 

 

Please select the Accept as Solution button if my post solves your issue or answers your question.


John Vellek


Join the Autodesk Customer Council - Interact with developers, provide feedback on current and future software releases, and beta test the latest software!

Autodesk Knowledge Network | Autodesk Account | Product Feedback
0 Likes
Message 17 of 20

Josephine2022
Explorer
Explorer

Hi I realise this is a very old thread, but I can't see an answer to this bug re 'nowhere/ blank' designation in the layer properties after combining. I am trying to clean up a drawing,

 

I've tried combining layers ( eg. '01 window tags' with '01 window') which it allows me to do, but the objects from the unwanted layer that is now gone have no designation in the layer property box. This is my main problem

 

I've tried manually moving the objects (incl. within blocks) to the correct layer and purging and deleting, neither allowed me to delete the layer.

 

I tried laymrg using some temporary rectangles on different layers ( eg. '01 window tags' and '01 window') this put both boxes on the same layer but it didn't move linework within blocks and it didn't delete the unwanted layer, perhaps I used this command wrong? Do you have to combine with layer 0?

 

I am using autocad lt 2023 on mac

 

Many thanks

Jo

0 Likes
Message 18 of 20

maxim_k
Consultant
Consultant

Hi @Josephine2022 ,

 

I tried the method described >>>>here<<< and it works fine in AutoCAD 2023 for Mac (I don't have LT version installed).

I was able to combine one of the layers in the drawing with another one and objects inside block were moved correctly.

 


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes
Message 19 of 20

Josephine2022
Explorer
Explorer

Thanks Maxim, 

 

Given your reply, I decided to test it out with two new blocks with simple geometry inside, each set of geometry (internally) on the different layers ( it worked as intended). 

 

I checked my old block again (It definitely doesn't work). This is a dynamic block with 4  embedded blocks on different visibility states i.e its a bathtub block with different sub-blocks for long elev, short elev, section, and plan. 

 

This made me check another old block with simpler geometry. This worked. (edit actually not a dynamic block, checking that now)

Edit: Have now checked another old dynamic block (that has a stretch parameter and visibility) but no embedded blocks, this also worked.

 

So the problem seems to be with embedded blocks, any thoughts?

 

Thanks again

Jo

 

Edit: Not very useful in my case but I've found that if there is an instance of the embedded (nested block) outside the block when I do the combine, it changes to the new layer, the embedded one does not. However if I then hit regen, the embedded one updates to the correct layer. Regen doesn't work otherwise. 

0 Likes
Message 20 of 20

maxim_k
Consultant
Consultant

Hi Jo,

 


@Josephine2022 wrote:

.......

 

So the problem seems to be with embedded blocks, any thoughts?

....


It looks like - yes, that's the thing


Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.


Maxim Kanaev
Architect
MARSS

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Likes