I have been getting the "no canas exists: please select a new canvas" error message for a couple days now when trying to run my LISP code. The objective of this section of code is to place a new title block and border into a drawing.
(command "expert" "5") (cond ((= letnum 1) ( (command "cmdecho" "0") (command "attdia" "0") (command "attreq" "1") (command "clayer" "0") (setq dnm (ts_dname)) ;CURRENT DWG NAME (command ".insert" "COMPANY_AB=COMPANY_AB""0,0" fact """0" ) (command ".insert" "COMPANY_TB=COMPANY_TB" "9.75,0" fact "" "0" "" """" "" "1" "1" """" "" "" "" """" ) (command "attdia" "1") ;;(command "cmdecho" "1") (command "expert" "0") ) ) ((= letnum 2) ( (command "cmdecho" "0") (command "attdia" "0") (command "attreq" "1") (command "clayer" "0") (setq dnm (ts_dname)) ;CURRENT DWG NAME (setq loc (* 15.75 fact)) (rho loc 2 2) (setq loc (strcat 'loc "," "0")) (command ".insert" "COMPANY_AB=COMPANY_BB""0,0" fact """0" ) (command ".insert" "COMPANY_TB=COMPANY_TB" loc fact "" "0" "" """" "" "1" "1" """" "" "" "" """" ) (command "attdia" "1") ;;(command "cmdecho" "1") (command "expert" "0") ) ) ((= letnum 3) ( (command "cmdecho" "0") (command "attdia" "0") (command "attreq" "1") (command "clayer" "0") (setq dnm (ts_dname)) ;CURRENT DWG NAME (setq loc (* 20.5 fact)) (rtos loc 2 2) (setq loc (strcat 'loc "," "0")) (command ".insert" "COMPANY_AB=COMPANY_CB""0,0" fact """0" ) (command ".insert" "COMPANY_TB=COMPANY_TB" loc fact "" "0" "" """" "" "1" "1" """" "" "" "" """" ) (command "attdia" "1") ;;(command "cmdecho" "1") (command "expert" "0") ) ) ((= letnum 4) ( (command "cmdecho" "0") (command "attdia" "0") (command "attreq" "1") (command "clayer" "0") (setq dnm (ts_dname)) ;CURRENT DWG NAME (setq loc (* 32.5 fact)) (setq loc (rtos loc)) (setq loc (strcat loc "," "0")) (command ".insert" "COMPANY_AB=COMPANY_DB""0,0" fact """0" ) (command ".insert" "COMPANY_TB=COMPANY_TB" loc fact "" "0" "" """" "" "1" "1" """" "" "" "" """" ) (command "attdia" "1") ;;(command "cmdecho" "1") (command "expert" "0") ) ) (t ((alert "Could not find title block in file")(command "expert" "0"))) )