Message 1 of 11
Renaming *-E Layer Names to Exst

Not applicable
03-04-2008
01:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to rename a group of layers that end with -E to Exst But thing
is I want to get rid of the -E and everytime I run my macro it just adds
Exst to the end of my layer names... does any one know how to subtrat the
last 2 characters and swap the name to Exst?
Public Sub RenameLayers()
Dim lays As AcadLayers
Dim layerObj As AcadLayer
Dim lay As AcadLayer
Dim strLayerName As String
On Error Resume Next
Set lays = ThisDrawing.Layers
For Each lay In lays
Set layerObj = ThisDrawing.Layers(lay.Name)
strLayerName = layerObj.Name
layerObj.Name = strLayerName & "Exst"
Next lay
End Sub
is I want to get rid of the -E and everytime I run my macro it just adds
Exst to the end of my layer names... does any one know how to subtrat the
last 2 characters and swap the name to Exst?
Public Sub RenameLayers()
Dim lays As AcadLayers
Dim layerObj As AcadLayer
Dim lay As AcadLayer
Dim strLayerName As String
On Error Resume Next
Set lays = ThisDrawing.Layers
For Each lay In lays
Set layerObj = ThisDrawing.Layers(lay.Name)
strLayerName = layerObj.Name
layerObj.Name = strLayerName & "Exst"
Next lay
End Sub