Changing Attribute Tag Names

Changing Attribute Tag Names

hroatch4PJ2V
Participant Participant
3,310 Views
14 Replies
Message 1 of 15

Changing Attribute Tag Names

hroatch4PJ2V
Participant
Participant

I am wondering if there is an easy way to change multiple different block attribute tag names without having to use BATTMAN. My issue is that I have over 400 different blocks which all have attributes with tag names like 1, 2, 3, 4,...etc. but I would like to change these attribute tags to what each number actually represents rather than the numbers (i.e. 1 -> Part Number, 2 -> Part Description, etc.) I can't export the attribute tags because these attributes are constants and not considered true attributes. We only use these constant attributes so that we can export the data for parts list but we don't want people to have to constantly get the attribute editor pop up every time they insert these blocks. I am using AutoCAD 2025.

0 Likes
3,311 Views
14 Replies
Replies (14)
Message 2 of 15

jreidKVSUZ
Collaborator
Collaborator

Not knowing what version of AutoCAD you are running, but if you have Full Blown AutoCAD and not Lite, try a LISP program to see if that will solved what you need for your attributes. 

I used my Friend Google and he came up with a lot of options that you can read and possible use.

See Link Below.

Hope this helps!

JRR!

 

https://www.google.com/search?q=lisp+routine+to+change+block+attributes&rlz=1C1OPNX_enUS1085US1085&o...

 

 

0 Likes
Message 3 of 15

hroatch4PJ2V
Participant
Participant

I tried looking through Google and did not come up with the solution that I am looking for. I am not trying to change the attribute values as I already know how to do that. I want to change the tags globally for over 400 blocks.

 

I did also mention that I am using AutoCAD 2025.

0 Likes
Message 4 of 15

pendean
Community Legend
Community Legend

@hroatch4PJ2V wrote:

...we don't want people to have to constantly get the attribute editor pop up every time they insert these blocks....


May I ask, why don't you just turn that feature off? ATTREQ variable is one method of a few to consider.


Can you share a DWG file with a few of your custom blocks in them, and point in there to which ones you wish to easily edit?

0 Likes
Message 5 of 15

paullimapa
Mentor
Mentor

If you rename or change the tag names all the existing values entered with the current tag name will be lost


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 6 of 15

baksconstructor
Advocate
Advocate

Try this. There is an option to replace the tag in many files.

 

tag.PNG

0 Likes
Message 7 of 15

jreidKVSUZ
Collaborator
Collaborator

Sorry Paul, I can't help on what he needs, but what you said is incorrect.

You can make a block and add tags lets say 1 & 2 and fill them in the Values with ONE & TWO.

I use Battman ON the block and change the tags to A & B.

Apply and Sync the block.

My Values remained to be ONE & TWO.  Only the Tag Names changed.

Thanks, JRR!

0 Likes
Message 8 of 15

paullimapa
Mentor
Mentor

You are correct when you use BATTMAN to do both renaming the Tag and then Sync.

But if you were to use lisp to access the block definition and change the Attdef Tag name and then run the ATTSYNC command, all the values would be lost. 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 9 of 15

hroatch4PJ2V
Participant
Participant
I tried this and it didn't work.
0 Likes
Message 10 of 15

hroatch4PJ2V
Participant
Participant

I have over 400 blocks to change. I am not going to spend my entire week manually changing all the attribute tags. It is just not a good use of my time. I was just trying to see if there was a simple solution. Otherwise I will just leave my blocks the way they are.

 

I am attaching a drawing and an image. The drawing are just a few blocks with the attributes in it. The image shows the attributes. The attribute tags are 1, 2, 3, ...., 11, 12. I want to change the numbers on the attribute tags for all of my 400+ blocks without losing data if this is even possible. BATTMAN and gatte will not work as it would be too time consuming.

0 Likes
Message 11 of 15

paullimapa
Mentor
Mentor

If you're saying you want the Tag names to = Default value then this cannot be done.

TAGs have naming restrictions. For example spaces are not allowed:

paullimapa_0-1726860352150.png

paullimapa_1-1726860372307.png

 

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 12 of 15

hroatch4PJ2V
Participant
Participant

I know that tags have naming restrictions. What I want is to change the tag number to a descriptive tag vs the numbers.
Example:
1 -> GL_Part_Number
2 -> GL_Description
And so on.

 

It is just that the numbers confuse my users when I export the data for a parts list.

0 Likes
Message 13 of 15

pendean
Community Legend
Community Legend

@hroatch4PJ2V Not tested any of the LISP but this old discussion seems to explore what you seek here

https://www.cadtutor.net/forum/topic/23977-change-attribute-tags-for-blocks-using-lisp/?do=findComme... 

0 Likes
Message 14 of 15

paullimapa
Mentor
Mentor

Per @pendean link to code, looks like what I missed was the other half of the equation.

Using Lisp to just rename the Block Definition's Attdef Tag name gets me only half way there for future Block Inserts.

But the 2nd part is again using Lisp to automatically select all the already Inserted Blocks and rename those Attribute Tag names as well. Then running an Attsync would no longer wipe out the existing Attribute values.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 15 of 15

paullimapa
Mentor
Mentor

But to automate the process it'll be easier to take the descriptive tag names from the existing constant attribute values the blocks already have replacing spaces any other characters that are not supported for example with an underscore.

Or do you have another list of tag names in mind that goes from 1 through 12?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes