PDA

View Full Version : All layers but current


tflaherty
2005-06-02, 06:49 PM
Does anybody have a simple routine to off all the layers but the current one?

Thanks

fixo
2005-06-02, 07:14 PM
Play with this
Thanx

Opie
2005-06-02, 07:34 PM
Does anybody have a simple routine to off all the layers but the current one?

Thanks
There is a routine to do such a thing with the express tools, if you have them.

tflaherty
2005-06-02, 07:45 PM
Yes, but can I use it inside another LISP routine?

miff
2005-06-02, 07:55 PM
(command "-layer" "off" "*" "n" "")

madcadder
2005-06-02, 08:10 PM
All but the current off...


(DEFUN c:alloff (/ |clayer|)
(SETQ |clayer| (GETVAR "clayer"))
(COMMAND "-layer" "off" "*" "n" "")
(PRINC)
)

madcadder
2005-06-02, 08:27 PM
If ON layer needs to be selected.


(DEFUN c:pickalloff (/ |ent| |layer|)
(PROMPT "\nPick entity on layer to remain ON: ")
(SETQ |ent| (ENTGET (CAR (ENTSEL))))
(SETQ |layer| (CDR (ASSOC 8 |ent|)))
(COMMAND "-layer" "set" |layer| "off" "*" "n" "")
(PRINC)
)