Replace characters in layer names ?

Discussion in 'AutoCAD' started by Miles, Jun 8, 2004.

  1. Miles

    Miles Guest

    Does anyone have a function that will replace -'s with _'s in layer names ?
     
    Miles, Jun 8, 2004
    #1
  2. Miles

    Norman Yuan Guest

    Try following code:

    Dim objLayer as AcadLayer
    For Each objLayer In ThisDrawing.Layers
    objLayer.Name=Replace(objLayer.Name, "-'s", "_'s")
    Next

    Note: Replace() function in VBA is only available with Acad2000i or later.
     
    Norman Yuan, Jun 8, 2004
    #2
  3. Miles

    Miles Guest

    Thank you.

     
    Miles, Jun 9, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.