I am pretty new to Lisp, so hopefully someone can point out what I am missing. I am having one problem with the lisp that I pieced together from a few other routines. I am writing a routine to create mtext that is scaled according to the dimscale and set to the correct layer. When I run the routine below, it works except the text is placed on the current layer instead of the one specified in the routine. I am trying to save the current layer, set the text layer, make the text, and change the layer back to previously current, but something must be wrong with that logic. (defun C:SCMTEXT () (setvar "cmdecho" 0) (setq Cl (getvar "CLAYER")) (setq dsc (getvar "DIMSCALE")) (setq osm (getvar "osmode")) (setvar "osmode" 0) (setvar "attdia" 1) (setvar "attreq" 1) (setq b (tblsearch "layer" "AN_NOTE")) (if (= b nil)(command "-layer" "n" "AN_NOTE" "c" "131" "AN_NOTE" "")) (setvar "textsize" (/ dsc 12.8)) (command "-layer" "s" "AN_NOTE" "") (initdia) (command ".mtext" pause) (setvar "clayer" cl) (setvar "osmode" osm) (setvar "cmdecho" 1) (princ) )