Since I am a newbie to the LISP world I am trying to create this lisp that works great for one condition without the conditional callout, but when I do add conditions it does not do what it is supposed to do (attaching a drawing to the current drawing using the mapping tools.
So the code is this :
So what am I missing under the conditions?Code:;*** ;***Insert Data ;*** (defun c:esd_gcid ( / GRDREF MAPPATH) (setvar "cmdecho" 1) (setvar "filedia" 0) (setvar "cmddia" 0) (command "layer" "M" "G-NPLT" "") (command "rectang" PAUSE PAUSE) (princ "\nCAD data...") (setq GRDREF (getstring "Enter CAD Data Name: ")) (cond ( (= GRDDEF "TCAD") (setq MAPPATH (strcat "M:\\GIS-CAD\\Cadastre\\TCAD\\DWG\\" GRDREF))) ( (= GRDDEF "TCAD-TEXT") (setq MAPPATH (strcat "M:\\GIS-CAD\\Cadastre\\TCAD\\DWG\\" GRDREF))) ) (command "adedrawings" "AT" MAPPATH "X") (command "adequery" "C" "D" "L" "L" "P" "C" PAUSE "X" "E" "D") (command "adedrawings" "DE" "*" "X") (setvar "cmddia" 1) (setvar "filedia" 1) (princ) ) The original script with only one condition works fine as (defun c:esd_gcid ( / GRDREF MAPPATH) (setvar "cmdecho" 1) (setvar "filedia" 0) (setvar "cmddia" 0) (command "layer" "M" "G-NPLT" "") (command "rectang" PAUSE PAUSE) (princ "\nCAD data...") (setq GRDREF (getstring "Enter CAD Data Name: ")) (setq MAPPATH (strcat "M:\\GIS-CAD\\Cadastre\\TCAD\\DWG\\" GRDREF)) (command "adedrawings" "AT" MAPPATH "X") (command "adequery" "C" "D" "L" "L" "P" "C" PAUSE "X" "E" "D") (command "adedrawings" "DE" "*" "X") (setvar "cmddia" 1) (setvar "filedia" 1) (princ) )