How to Make an Attribute the Layer Name(autocad2013)

Hello

After a lot of research I couldn't find the solution, I have posts that have been integrated on autocad but the problem is that each one corresponds to a different layer with the name of my post as the name of the layer. I would like that for each of these layers in my "post" block I can replace the "name" label with the name of the layer (so that it is consistent). I tested the 'Clayer' system variable but as its name suggests, it gives me the name of the current layer and the name of the layer of which the object is a part.

Knowing that I have more than 2500 elements, I would like to know if there is a system variable or something like that allows you to fill an attribute with the value of the layer that it is a part of.

thanking you in advance;)

Hello

After some research, I found this solution that I only managed to get to work by adding a new attribute to the existing block. If you modify an already existing attribute, it doesn't work, at least I didn't succeed:

1 - Open the block editor to edit the pole block

2- Create a new attribute with the following parameters:

     - Label = postname (different from an existing label)
     - Default = Click on the "Insert Field" button

          -- Field Category = Objects
          -- Field Names = BlockPlaceholder
          -- Block reference property = Layer
          OK

     - Check the "Predefined" box
     - Adjust text settings to your liking

3- Possibly delete the existing attribute that no longer needs to be

4- Close the block editor by saving the changes (the opposite would be silly!!)

5- Run the "ATTSYNC" command (Synchronize attributes)

     - Press the "Enter" key to select the block
     - Press "Enter" to confirm the sync.

Normally, the name of the layer in which the frame is inserted should be displayed.

Be careful, in this case, it is not the name of the layer in which the features of the block are created that is displayed (usually the "0" layer).

If you have several different pole blocks, you must follow this procedure for each block.

Hoping to have helped you,

Eric R.
 

1 Like

Hello

Thank you very much for the solution, I have to tinker with a ty thing so that it only changes the value once (to integrate my posts on another layer afterwards) and it will be good^^

You can'  t imagine the time saving it's going to be, just a dxf export from qgis, a blockreplace and an attsync i.e. 5min while before people wasted a lot of time naming.

Thank you again!