rename layers with lisp..

Discussion in 'AutoCAD' started by C Witt, Sep 17, 2004.

  1. C Witt

    C Witt Guest

    We just recived a dwaring back from one of our contractors, and they
    have renamed all our layers by adding "0379-006" (the job #) to the
    start of all the names.. then added their own layers..

    I need to find all the "changed" layers and remove the "0379-006"..

    I did a qick seach and found a few ideas.. but none specific to this
    situation...

    TIA.

    (btw, this lisp only needs to run in one drawing.. if that matters)
     
    C Witt, Sep 17, 2004
    #1
  2. C Witt

    T.Willey Guest

    Just get a list of all the layers in the drawing, then foreach item in the list, see if it has a prefix of "0379-006", if so then pass it to the rename command, and remove the "0379-006" from the layer name. I don't think it will be to hard to write.

    Tim
     
    T.Willey, Sep 17, 2004
    #2
  3. C Witt

    Dave Jones Guest

    list, see if it has a prefix of "0379-006", if so then pass it to the rename
    command, and remove the "0379-006" from the layer name. I don't think it
    will be to hard to write.
    why not just use RENAME/Layers and use 0379-006* for a layer name and * for
    a replacement name. Works here in 2005. Quick and dirty :)
    Dave
    DDP
     
    Dave Jones, Sep 17, 2004
    #3
  4. C Witt

    T.Willey Guest

    Dave,

    Nice. Worked in A2K4 also, never thought of doing that.

    Tim
     
    T.Willey, Sep 17, 2004
    #4
  5. C Witt

    C Witt Guest

    ERR.. That was too easy.

     
    C Witt, Sep 17, 2004
    #5
  6. C Witt

    Dave Jones Guest

    after 14 years of sitting in front of this monitor running Acad I find that
    easy is good :)
     
    Dave Jones, Sep 17, 2004
    #6
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.