Rename just layers that are turned on

Discussion in 'AutoCAD' started by bmossman, Sep 22, 2004.

  1. bmossman

    bmossman Guest

    How do i modify the following routine to rename just the layers that are currently turned on?

    ;Adds a specified layer prefix to all layers

    (defun C:lprefix ()
    (vl-load-com)
    (setq pre (getstring "\nEnter Layer Prefix : "))
    (setq doc (vla-get-activedocument
    (vlax-get-acad-object)
    )
    layers (vla-get-layers doc)
    )
    (vlax-for lay layers
    (setq lname (vla-get-name lay))
    (if (not (member lname '("0" "Defpoints")))
    (vla-put-Name lay (strcat pre lname))
    )
    )
    )
    (princ)
     
    bmossman, Sep 22, 2004
    #1
  2. bmossman

    Kelie Guest

    (if (and
    (not (member lname '("0" "Defpoints")))
    (eq :vlax-true (vla-get-layeron lay))
    )
    (vla-put-name lay (strcat pre lname))
    )
     
    Kelie, Sep 23, 2004
    #2
  3. bmossman

    bmossman Guest

    thanks so much for your help!
     
    bmossman, Sep 23, 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.