set layer

Discussion in 'AutoCAD' started by Philip Russell, Oct 1, 2003.

  1. Hi all,

    I am looking for a Set Layer lisp routine. I would like to be able to click
    a layer and the routine to make it current.

    Thanks in advance.
    Phil
     
    Philip Russell, Oct 1, 2003
    #1
  2. LSET will do that:

    (defun c:lset (/ a2 bw l1 l2)
    (setvar "CMDECHO" 0)
    (prompt "Select entity on target layer") (terpri)
    (setq a2 (entsel))
    (setq b2 (entget (car a2)))
    (setq l1 (assoc 8 b2))
    (setq l2 (cdr l1))
    (command "layer" "s" l2 "")
    (princ)
    )

    (I don't have any credits for this thing and don't know who wrote it.)
     
    Michael Bulatovich, Oct 1, 2003
    #2
  3. Philip Russell

    Tim S Guest

    AutoCAD already has the "Make Object's Layer Current" button which does
    that. If you want more features, like turning on or thawing a layer and
    making it current, try the PRO Menu trial version, at the link below.
     
    Tim S, Oct 1, 2003
    #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.