I am trying to write a VBA program that will rewrite over some layer names in AutoCAD 2005 that have a $ or &. The default layer manager seems to have a problem with these symbols. So I kind of new to the VBA system I written a couple programs, but I still rely heavily on books and google (love the google). I read that you can use Regular Expressions in VBA, but you need to add some extensions. How do I do that? Is it code like to a library? Can I do that in Microsoft Visual Basic Editor?
Any help would be appreciated. The code below is the first half it should look throu the layers and MsgBox out the ones that have the symbols in them.
Sub Layer_Management()
' Improves layer management response time by removing text that lengthen query time
' Macro created 02/15/2005 by David Powers
On Error Resume Next
Dim ABCLayer As AcadLayer
Dim oReg As RegExp
Set oReg = New RegExp
With oReg
.IgnoreCase = False
.Pattern = ".*?($|&)"
End With
Set ABCLayer = ThisDrawing.Layers(oReg)
If Err <> 0 Then
MsgBox "No layers with $, & exist in drawing."
End If
Any help would be appreciated. The code below is the first half it should look throu the layers and MsgBox out the ones that have the symbols in them.
Sub Layer_Management()
' Improves layer management response time by removing text that lengthen query time
' Macro created 02/15/2005 by David Powers
On Error Resume Next
Dim ABCLayer As AcadLayer
Dim oReg As RegExp
Set oReg = New RegExp
With oReg
.IgnoreCase = False
.Pattern = ".*?($|&)"
End With
Set ABCLayer = ThisDrawing.Layers(oReg)
If Err <> 0 Then
MsgBox "No layers with $, & exist in drawing."
End If