- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys, I thought this would be easy but it's just not working for me and I've searched the help, these forums and I can't find anything.
When you search for a layer in CAD, if you put *TEXT* any layer with TEXT in the name will appear. This doesn't work when writing code though!! My example is shown below which doesn't work...... without the asterisk (*) it will change the layer "New" to "MEPHAN" but I want all layers with the word "New" to be changed to "MEPHAN".. (example "xref_New", "New_copy", etc). The asterisk is supposed to be for a string of characters, don't see why it doesn't work. Also, is there any character for a sequence of numbers? the (#) symbol only works for single numbers.
Dim oLayers As AcadLayers
Set oLayers = ThisDrawing.Layers
Dim oLayer As AcadLayer
Dim ent As AcadEntity
For Each ent In ThisDrawing.ModelSpace
If ent.Layer = "*New*" Then
ent.Layer = "MEPHAN"
End If
Next
Thanks for any input!!
Solved! Go to Solution.