I'm working on getting all xrefs to be automatically put on layer 0 (no comments on that please) so I have this so far: (vl-load-com) (setvar "cmdecho" 0) (command "._undefine" "xref") (setvar "cmdecho" 1) (defun c:xref ( / x *acad-object* *acad-doc*) (setq *acad-object* (vlax-get-acad-object)) (setq *acad-doc* (vla-get-activedocument *acad-object*)) (setq x (vla-add (vla-get-layers *acad-doc*) "0")) (vla-put-activelayer *acad-doc* x) (vla-sendCommand *acad-doc* "._XREF ") (vlax-release-object *acad-doc*) (vlax-release-object *acad-object*) ) It works great, but I'd like to be able to set it back to the previous layer after the xref is done being dropped in. How do I get it to pause for the user input and the perform the command?