Script - Change Block's+Dependencies layer but Maintain All Colors

Hi All,

When importing some autocad drawings i want to move them on a specific layer.
Usually there are many nested blocks which are making my layer layout look messy every time i import an autocad drawing.
For that reason what i would like to find a way to move the selected block (and all dependencies) to one layer and also to maintain the color properties.

To give an example:

In screenshot below the block belongs to layer Block-Truck.
I would like to move the block of truck to their respective Deck Level and be able to purge and remove the layer Block truck.

block.3dm (53.2 KB)

Would that be possible?

Hi @g.synetos,

Seems like you should be able to do this with the BlockEdit command. Or do you need to script this and are wondering where to start?

– Dale

Hi @dale, this is a part of a larger script that i m working on so i would like some hints/directions how to achieve that.