Convert All Objects and Nested Blocks to 1 Layer

Convert All Objects and Nested Blocks to 1 Layer

Anonymous
Not applicable
71,542 Views
31 Replies
Message 1 of 32

Convert All Objects and Nested Blocks to 1 Layer

Anonymous
Not applicable

I need to select an entire drawing and convert all objects including nested blocks to one and the same layer. Can anybody possibly help with a script?

Accepted solutions (3)
71,543 Views
31 Replies
Replies (31)
Message 2 of 32

Vinayv4v
Advisor
Advisor

Hi,

 

First use the command SETBYLAYER > All (for all objects) > enter>yes (to include all blocks) > enter

Enter to change all the layers including nested blocks to assign the color of layer.

 

Second use the LAYMCH > All > Enter, then choose an object with the layer which you have to set for all layers or type the name of the layer you want to set as final.

 

Here is a screen cast showing how to use the LAYMCH.

Cheers,

Vinay Vijayakumaran

Message 3 of 32

Anonymous
Not applicable

Thanks for your help. I've been playing with theses commands. The problem I'm having is that there are still nested blocks that remain on other layers.

When I select one and use "Block Edit" command you can see that they remain on their original layer. We export points to a total station and the handheld device works best if I can purge all but 1 layer. I can't do that with nested blocks unless I do multiple explode commands, then the file size increases quite a bit.

0 Likes
Message 4 of 32

Vinayv4v
Advisor
Advisor

Hi,

 

Is it possible for you to upload the file so that I may give it a try ? 

Cheers,

Vinay Vijayakumaran

0 Likes
Message 5 of 32

Anonymous
Not applicable

Here is a sample background we get from the arch/revit file.

It has nested blocks that remain on original layers. I would like to combine then purge all unused layers, basically get it down to 1 layer.

Thanks for trying.

0 Likes
Message 6 of 32

Victoria.Studley
Autodesk
Autodesk

Hi @Anonymous,

 

Thank you for posting your sample file here for testing. It looks like a lot of the blocks you're trying to change contain geometry that is placed on the individual layers you're trying to purge.

 

I believe you need to modify each of the blocks, changing all the geometry within them from specific layers to Layer=0, in order to achieve what you asking for here. I don't think there's an easy way to do this, aside from modifying each block via the Block Editor.

 

If you're open to using some customization, maybe the recommendation in this AUGI thread might help.

 

Perhaps some other users can recommend a different method?


Victoria Studley
Principal Experience Designer - Fusion Configurations
Join us in the Fusion Insider Program
Fusion Learn & Support | Fusion Documentation
0 Likes
Message 7 of 32

Anonymous
Not applicable

Thank you, I will look into this.

0 Likes
Message 8 of 32

Vinayv4v
Advisor
Advisor
Accepted solution

Hi,

 

Sorry for the late reply.

You can try some lisps to do the work.

Here are some attached Lisps

 

1. Layerfix

    Description: Changes the block definitions to Layer 0, Other properties will remain . Will skip all

    Command : BL03

 

2. Fixblock

    Description: Puts all of a blocks sub-entities on layer

    Command : Blast

 

3. Beltb

    Description : change all Block Entities of definitions of a selected block and all

     nested block definitions within it to the Layer of the Top-level Block.

     Command : Beltb

Cheers,

Vinay Vijayakumaran

Message 9 of 32

Anonymous
Not applicable

Thank you. I will play with these and let you know how they worked.

0 Likes
Message 10 of 32

Anonymous
Not applicable

Layerfix did the trick, thanks for all of your help.

Message 11 of 32

Anonymous
Not applicable

Do you have an idea how can I do the same but in a mac autocad 2017. I tried everything that I see on the internet but those commands doesn't exist in the mac. And I've seeing some people posting some kind of code but i dont know how to ran it on a mac as well.

0 Likes
Message 12 of 32

arkelec
Collaborator
Collaborator

Hi Vinayv4v, thanks for posting your solutions.

 

Is it possible to modify the FixBlock LISP to select multiple blocks? 

0 Likes
Message 13 of 32

Vinayv4v
Advisor
Advisor

Sorry.

I am not that good at programming.

Cheers,

Vinay Vijayakumaran

0 Likes
Message 14 of 32

arkelec
Collaborator
Collaborator

No worries, thanks for the quick response.

0 Likes
Message 15 of 32

Baltona
Contributor
Contributor

thanks for the tip.  let me try out 

0 Likes
Message 16 of 32

Vinayv4v
Advisor
Advisor

Also try the first suggestion. 

 

SETBYLAYER & LAYMCH as shown in the screencast.

Cheers,

Vinay Vijayakumaran

0 Likes
Message 17 of 32

Baltona
Contributor
Contributor

color didn't change at all , any advise please remember multiple blocks are inside single block 

0 Likes
Message 18 of 32

Vinayv4v
Advisor
Advisor

Hi,

 

Use SETBYLAYER > Select objects > change by blocks to by layer > yes.

Then try the Lisp. 

Cheers,

Vinay Vijayakumaran

0 Likes
Message 19 of 32

Baltona
Contributor
Contributor

I had  tried several times upload lips but it did not loud up into system acad2017  two of those im having truble fixblock & layerfix

0 Likes
Message 20 of 32

Vinayv4v
Advisor
Advisor

Hi,

 

Are you using the command APPLOAD to load the Lisp ?

 

You are not using Autocad 2017 LT ?

Cheers,

Vinay Vijayakumaran

0 Likes