oops.. wrong thread
anyhoo...
Edit: I was called away when i was about to reply to another thread but somebody mess with my station.. serves me right not locking my desktop


Registered forum members do not see this ad.
Hi All,
I want a quick LISP command to change the current layer to 0 but not just do that, i want to be able to select objects first to change, so it changes all selected objects and the drawing's current layer to 0. I've tried this code out but it won't work (not the changing slected objects bit anyway)....any ideas on what i'm doing wrong or a better solution to my code?
Thanks,Code:; SET OBJECTS AND CURRENT LAYER TO 0.. (defun C:00 () (setq a (cadr (ssgetfirst))) (if a (command "-LAYER" "S" " " a "S" "0" "")) (princ) )
Cheers,
PaulRenegade @ hardwiredstudios..
XP Pro / AutoCAD 2007 : Pentium Core 2 Q6600 Quad Core : ASUS P5N-E SLI Motherboard : 4GB DDR2 RAM : 2 x SLI NVIDIA 8500GT SLi 1024MB DDR2 PCI-Express Graphics Cards
oops.. wrong thread
anyhoo...
Edit: I was called away when i was about to reply to another thread but somebody mess with my station.. serves me right not locking my desktop
Last edited by pBe; 5th Jan 2011 at 12:50 pm.
maybe:
I wouldn't recommend using numeric characters ( if that is what they are ) as the leading character or all characters in a function name. I couldn't tell if they were zeros or the letter O. -DavidCode:(defun c:oo (/ ss) (while (not ss) (princ "\nSelect Entites To Change To Layer 0") (setq ss (ssget))) (command "_.LAYER" "_UNlock" "0" "_Thaw" "0" "_ON" "0" "_Set" "0" "" "_.CHPROP" ss "" "_LA" "0" "") (prin1))
R12 (Dos) - A2K
Or if you want to use the pre-selection:Code:(defun C:00 (/ a) (if (setq a (cadr (ssgetfirst))) (command "_.change" a "" "_Properties" "_LAyer" "0" "") ) (command "_.LAYER" "_Set" "0" "") (princ) )


Registered forum members do not see this ad.
#3 + #4 = #5
Code:(defun C:00 ( / ss) (if (or (setq ss (cadr (ssgetfirst))) (and (princ "\nSelect Entites To Change To Layer 0") (setq ss (ssget "_:L")) ) ) (command "_.LAYER" "_UNlock" "0" "_Thaw" "0" "_ON" "0" "_Set" "0" "" "_.CHPROP" ss "" "_LA" "0" "") ) (princ) )
Bookmarks