LISP Command is Re-entered in the middle of LISP routine
Hello all,
I have run up against an issue where when I run a LISP routine, it creates an error by re-entering the command used to start the LISP routine. Below is a segment of my code:
(defun C:LAYERMERGEUPDATE ()
(setvar "CMDECHO" 0)
(if (tblsearch "LAYER" "S-ANNO-TTLB")(command ".-laymrg" "n" "S-ANNO-TTLB" "" "n" "0" "y"))
(if (tblsearch "LAYER" "Defpoints")(command ".-laymrg" "n" "Defpoints" "" "n" "0-Defpoints" "y"))
(if (tblsearch "LAYER" "S-ANNO-DIMS-CENT")(command ".-laymrg" "n" "S-ANNO-DIMS-CENT" "" "n" "ANNO-CENTERLINE" "y"))
(if (tblsearch "LAYER" "S-ANNO-DIMS")(command ".-laymrg" "n" "S-ANNO-DIMS" "" "n" "ANNO-DIMENSIONS" "y"))
)
If I run this in a drawing, it searches for the layers that are present and should appropriately merge them to the new layer that already exists in the drawing. The problem I am having is that, for example, it finds "Defpoints" and merges it to "0-Defpoints", but when it gets to "S-ANNO-DIMS", I get the following output in my command line.
(Ignore the block redefining)
I think it has something to do with the double quotes to trigger an "enter" in the ".laymrg" command, but don't see a way around this.
I have a longer version of this code with all the old layer names mapped to the new layer names, but I can't get it to work for more then one layer.
Any assistance is greatly appreciated! Thanks!
Link copied