ACAD 2005 - BATCH LAYER RENAME
ACAD 2005 - BATCH LAYER RENAME
(OP)
I have used the _laytrans command in autocad which works fine but is there a command or routine which will change the names of layers by adding or subtracting or replacing text strings of layers globally?





RE: ACAD 2005 - BATCH LAYER RENAME
"Everybody is ignorant, only on different subjects." — Will Rogers
RE: ACAD 2005 - BATCH LAYER RENAME
K--DI--
text on the front of the layer name.
RE: ACAD 2005 - BATCH LAYER RENAME
http://www
____________________
Acad2005, Terramodel
RE: ACAD 2005 - BATCH LAYER RENAME
This routine will place a Prefix in front of all Layer names ;and rename them.
Of course, it will not rename Layer "0" or "Defpoints".
(prompt "\nType ChLayName to run.........")
(defun C:ChLayName ( / acadDocument theLayers layName pre)
(vl-load-com)
(setq pre (getstring "\nEnter Layer Prefix : "))
(setq acadDocument (vla-get-activedocument (vlax-get-acad-object)))
(setq theLayers (vla-get-layers acadDocument))
(vlax-map-collection theLayers 'layer-mod)
(princ)
);defun
(defun layer-mod (theLayer)
(setq layName (vlax-get-property theLayer 'Name))
(if (not (member layName '("0" "Defpoints")))
(vla-put-Name thelayer (strcat pre layName))
) ;if
);defun
(princ)
"Everybody is ignorant, only on different subjects." — Will Rogers
RE: ACAD 2005 - BATCH LAYER RENAME
Thanks for making my day. I just got the train to work which was the wrong train and forgot to change because my book is rather good (Aurther and George by Julian Barnes), and then missed the next train as I began the long walk (its minus 10 and a metre of snow).
But that routine makes up for it. Cheers.
RE: ACAD 2005 - BATCH LAYER RENAME
"Everybody is ignorant, only on different subjects." — Will Rogers