set layer

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
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Philip Russell wrote:

If you mean by selecting an object, try ai_molc, the built-in routine.
If you mean by some other method, what exactly do you mean?
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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.)
--


MichaelB
www.michaelbulatovich.com
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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.
--

PRO Menu - The Productivity Toolbox for AutoCAD
www.multicim.com/pmenu.html
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.