Help: Script that copy's names from one child layer to another

In this topic’s first post you can see an example of what the problem is with the make2D in our case.

The problem arises because the Make2D option with “maintain source layers” takes the layers from the contents of the blocks. Rather then the actual layer the block is put in. This is not necessarily wrong behavior from the software but it causes us to have to go in afterwards and change all the prefix numbers and quantities from “1” to the proper amount, and removing the “[BLOCK]” parts of the names.

The prefix number and quantities we’ve set to 1 in the block as a default because they differ per product they are in. While making the products in 3D we place the blocks and move them to new layers with correct names. After this step we create 2D drawings using the “make2D” option.

Our goal would want to have the “maintain source layers” use the names of the layers the blocks are placed in.

I hope this information + the link to the post will explain our problem. The reason why i’m trying to get a script as this one working, is because I’m expecting that the “maintain source layers” option is working as intended, and this is only a problem for us.