I would recommend using an object snap modifier over changing the OSMODE system variable - this way, there is no need for an error handler, e.g.:
(defun c:mw ( / sel )
(if (setq sel (ssget "_:L"))
(command "_.move" sel "" "_end" "\\" "_end" "\\")
)
(princ)
)
Hi Lee,
you code is very efficient save for 2 things:
1) The OP asked to automatically start selection in a window selection mode - hence the command name "MW". SSGET must be supplied the 2 points ahead of time for this.
2) At least on my machine - when supplying the object snap modifiers within a command function, then pausing for user input, the Autosnap markers fail to show up. That is why I opted for changing the OSMODE.
Note - no disrespect meant Lee - you are an incredible coder. Just stating the reason I did the code the way I did it. Strange the OP seems to be satisfied with your code hoewever. Perhaps I misinterpreted what he wants?
- Phil.