I would like to know how I should go about
renaming the layers in my drawings with a prefix or suffix. Would this be better
accomplished with VBA?
No need to use VBA. Try this :
;CODING STARTS HERE
;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
(defun C:ChLayName ( / acadDocument theLayers layName)
(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)
(defun layer-mod (theLayer)
(setq layName (vlax-get-property theLayer 'Name))
(if (not (member layName '("0" "Defpoints")))
(vla-put-Name thelayer (strcat pre layName))
;CODING ENDS HERE