[Search tip detail and code files using keywords, tip number, author name, etc ]
Add and Remove Layer Name Prefixes
Tip# 3524 By Ren Smith On 07-Nov-2010
Rated By 1 users
Categories : Layer Properties
Software type : AutoCAD 2011
Rename File To : No Files to download.
Use wildcards to rename objects quickly.

Ren Smith sends us an AutoCAD tip for adding prefixes to Layer names — or removing them.

"I was looking for a way to add or remove a prefix to all layer names, but all I found were LISP routines for adding a prefix, not removing one. Before trying to write my own LISP routine I started playing with the Rename command, which brings up a dialog box to rename just about anything you want. I found that by using wildcards, you can rename everything, or just specific names, all at once.
"For example, in the Old Name box, add the wildcard * to select all names, and in the New Name box, enter a MC2-* (where MC2- is the prefix) and select Rename. Wow! All layer names now have a MC2- prefix.

"And it gets even better: You can use the same technique to remove a prefix. For example, In the Old Name box, add the wildcard MC2-* to select all names that start only with MC2- and in the New Name box enter just the * and select Rename.
"Now if you're thinking what I'm thinking, the answer is yes — it works on Block names, Dimension Style names, and all the other options in the Rename dialog window."

Notes from Cadalyst Tip Patrol: The Rename tool is a great feature in AutoCAD. It allows users to give new names to many objects and styles. Type Rename on the Command line to bring up the Rename dialog box. There are several types of Named Object categories: Blocks, Dimension Styles, Layers, Linetypes, and more. Select the type of Named Object you want to rename; this will bring up a list of the objects of that type in the file you are working on. Choose an object to rename it, or to rename multiple objects at once, use wildcards.


Average Rating:

User comments
Comment by Chenault,Kenneth
Posted on 2010-11-08 14:32:10
How about adding a suffix to all layer names? I have never had this work with this command. Someone actually created a lisp routine for me to do what I needed to save time and therefore money.
Comment by Evans,Lisa
Posted on 2010-11-08 15:21:22
I think this is great! I've used the Rename command before on blocks but never tried it on Layer names. I tried it and it also works to remove those pesky $0$ characters that are generated when people insist on Binding xrefs. Thanks!