cadmano Posted February 12, 2009 Posted February 12, 2009 I am extremely new to lisp and trying to learn on my own. (by the way this site has been incredible help! Thanks!) Can someone please help me. I am trying to figure out how to grab all objects from layer "0" and move it to a new layer called "Old_0". Quote
rkmcswain Posted February 12, 2009 Posted February 12, 2009 Here is one way. [color=blue][font="Courier New"] (defun C:mvlay ( / sset) [color="green"]; if the layer OLD_0 does not exist, then create it (i am making it blue)[/color] (if (not (tblsearch "LAYER" "OLD_0")) (command "._LAYER" "_N" "OLD_0" "_C" "5" "OLD_0" "" "") ) [color="green"]; grab everything on layer 0[/color] (setq sset (ssget "_X" '((8 . "0")))) [color="green"] ; change it to layer OLD_0[/color] (command "._change" sset "" "_P" "_LA" "OLD_0" "") (princ) ) [/font][/color] Quote
cadmano Posted February 12, 2009 Author Posted February 12, 2009 WOW it is that easy? Thanks it works great! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.