Select all on layer

Discussion in 'AutoCAD' started by sryan32, Dec 10, 2004.

  1. sryan32

    sryan32 Guest

    I am trying to select everything on a layer by picking an object on that layer, so that I can move all of the objects to another layer. I am having trouble at the end, I cannot find a way to keep the selection active at the end of my lisp routine so that I can move the objects to the new layer.

    Thanks for any ideas.
     
    sryan32, Dec 10, 2004
    #1
  2. sryan32

    T.Willey Guest

    Try this.

    Tim


    (defun c:FiLayer (/ ent1 lay1 ss)

    (if (setq ent1 (entsel "\n Select object to filter object by its layer. "))
    (setq lay1 (value 8 (entget (car ent1))))
    )
    (if lay1
    (if (setq ss (ssget "x" (list (cons 410 (getvar "ctab")) (cons 8 lay1))))
    (progn
    (sssetfirst nil ss)
    (prompt (strcat "\n Number of items: " (rtos (sslength ss) 2 0)))
    (prompt (strcat " On layer: " lay1))
    )
    (prompt (strcat "\n Nothing on layer \"" lay1 "\" in current tab."))
    )
    )
    (princ)
    )
     
    T.Willey, Dec 10, 2004
    #2
  3. Sounds like a job for Layer Merge (Express Tool), unless you want the "old"
    layer to remain in the drawing.
     
    Kent Cooper, AIA, Dec 12, 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.