home *** CD-ROM | disk | FTP | other *** search
- ;lesson2 lisp routine to check answers to CAD lesson #2
-
- (defun C:ANSWERS (/ set1 n na text blk an1 )
- (setq set1 (ssget '(2 5.6)))
- (if (= set1 nil)(command "insert" "bad" "8.08,6.5" "" "" "")(progn
- (setq n (sslength set1))
- (setq na (ssname set1 0))
- (setq text (cddr (entget na)))
- (setq blk (cdr (cadr(tblsearch "block" "square"))))
- (setq AN1 (strcase (cdr (assoc 2 text))))
- (IF (= blk an1)
- (command "insert" "ok" "8.08,6.5" "" "" "");then
- (command "insert" "bad" "8.08,6.5" "" "" ""))));else
- (redraw)
- (Q2)
- )
- (defun q2 ()
- (prompt "\nPLEASE READ QUESTION #2 BEFORE ANSWERING")
- (setq ans2 (strcase(getstring "\nENTER YOUR ANSWER TO QUESTION #2" )))
- (if (or(= ans2 "1")
- (= ans2 "ONE")
- )
- (PROGN(command "text" "1,4.5" "" ans2 )
- (command "insert" "ok" "8.08,6" "" "" ""))
- (PROGN(command "text" "1,4.5" "" ans2 )
- (command "insert" "bad" "8.08,6" "" "" "")))
- (REDRAW)
- (Q3)
- );end defunQ2
-
- (defun q3 ()
- (prompt "\nPLEASE READ QUESTION #3 BEFORE ANSWERING")
- (setq ans3 (strcase(getstring "\nENTER YOUR ANSWER TO QUESTION #3 <T/F>")))
- (if (= ans3 "F") (PROGN(command "text" "1,4" "" "F" )
- (command "insert" "ok" "8.08,5.5" "" "" ""))
- (PROGN(command "text" "1,4" "" "T" )
- (command "insert" "bad" "8.08,5.5" "" "" "")))
- (REDRAW)
- (PROMPT "\nPLEASE COMPLETE TASK IN QUESTION #4")
- (PROMPT "\nTHEN TYPE <CONT4> WHEN INSTRUCTED TO DO SO IN THE INSTRUCTIONS")
- );end defunQ3
-
- (defun C:CONT4 ()
- (prompt "\nPLEASE READ QUESTION #4 BEFORE ANSWERING")
- (setq ans4 (strcase(getstring "\nENTER YOUR ANSWER TO QUESTION #4 <T/F>")))
- (if (= ans4 "F") (PROGN(command "text" "1,2.5" "" "F" )
- (command "insert" "right" "8.08,5" "" "" ""))
- (PROGN(command "text" "1,2.5" "" "T" )
- (command "insert" "wrong" "8.08,5" "" "" "")))
- (REDRAW)
- (PROMPT "\nPLEASE COMPLETE TASK IN QUESTION #5")
- (PROMPT "\nTHEN TYPE <CONT5> WHEN INSTRUCTED TO DO SO IN THE INSTRUCTIONS")
- );end defunQ4
-
-
- (defun C:CONT5 ()
- (prompt "\nPLEASE READ QUESTION #5 BEFORE ANSWERING")
- (setq ans5 (strcase(getstring "\nENTER YOUR ANSWER TO QUESTION #5 <T/F>")))
- (if (= ans5 "T") (PROGN(command "text" "4.84,5" "" "T" )
- (command "insert" "ok" "8.08,4.5" "" "" ""))
- (PROGN(command "text" "4.84,5" "" "F" )
- (command "insert" "bad" "8.08,4.5" "" "" "")))
- (REDRAW)
- (q6)
- );end defunQ5
-
- (defun q6 ()
- (prompt "\nPLEASE READ QUESTION #6 BEFORE ANSWERING")
- (setq ans6 (strcase(getstring "\nENTER YOUR ANSWER TO QUESTION #6 ")))
- (if (= ans6 "C") (PROGN(command "text" "4.8,4.3" "" ans6 )
- (command "insert" "ok" "8.08,4" "" "" ""))
- (PROGN(command "text" "4.8,4.3" "" ans6 )
- (command "insert" "bad" "8.08,4" "" "" "")))
- (REDRAW)
- (q7)
- );end defun6
-
- (defun q7 ()
- (prompt "\nPLEASE READ QUESTION #7 BEFORE ANSWERING")
- (setq ans7 (strcase(getstring "\nENTER YOUR ANSWER TO QUESTION #7 <T/F>")))
- (if (= ans7 "T") (PROGN(command "text" "4.84,3.5" "" "T" )
- (command "insert" "ok" "8.08,3.5" "" "" ""))
- (PROGN(command "text" "4.84,3.5" "" "F" )
- (command "insert" "bad" "8.08,3.5" "" "" "")))
- (REDRAW)
- (PROMPT "\nPLEASE COMPLETE TASK IN QUESTION #8")
- (PROMPT "\nTHEN TYPE <CONT9> WHEN INSTRUCTED TO DO SO IN THE INSTRUCTIONS")
- );end defunQ7
-
- (defun c:cont9 ()
- (prompt "\nPLEASE READ QUESTION #9 BEFORE ANSWERING")
- (setq ans11 (strcase(getstring "\nENTER YOUR ANSWER TO QUESTION #9" )))
- (if (OR (= ans11 "A")
- (= ans11 "B")
- (= ans11 "C")
- )
- (command "insert" "closing" "5.23,1.47" "" "" ""))
- (REDRAW)
- (command "end" )
- );end defun9
- ;______________________________________________________
-
- (defun an2 ()
- ;first answer
- (defun a1 (/ seta n na tp tp1 mtl1)
- (setq seta (ssget '(1 6)))
- (setq n (sslength seta))
- (setq na (ssname seta 0))
- (setq tp (car(cdr(entget na))));next three lines check for no answer
- (setq tp1(cdr tp))
- (if (= tp1 "LINE")
- (command "insert" "bad" "8.08,6" "" "" "");then
- (progn(setq text (cddr (entget na)));else
- (setq mtl1 (list (strcase (cdr (assoc 1 text)))))
- (if (or(= (car mtl1) "ABSOLUTE")
- (= (car mtl1) "POLAR")
- (= (car mtl1) "RELATIVE")
- )
- (command "insert" "ok" "8.08,6" "" "" "")
- (command "insert" "bad" "8.08,6" "" "" ""));else
- ))
- )
- ;next answer
- (defun a2 (/ setb n na tp tp1)
- (setq setb (ssget '(1 5.8)))
- (setq n (sslength setb))
- (setq na (ssname setb 0))
- (setq tp (car(cdr(entget na))));next three lines check for no answer
- (setq tp1(cdr tp))
- (if (= tp1 "LINE")
- (command "insert" "bad" "8.65,6" "" "" "");then
- (progn(setq text (cddr (entget na)));else
- (setq mtl2 (list (strcase (cdr (assoc 1 text)))))
- (if (or(= (car mtl2) "ABSOLUTE")
- (= (car mtl2) "POLAR")
- (= (car mtl2) "RELATIVE")
- )
- (command "insert" "ok" "8.65,6" "" "" "")
- (command "insert" "bad" "8.65,6" "" "" ""));else
- ))
- )
- ; last answer
- (defun a3 (/ setc n na tp tp1)
- (setq setc (ssget '(1 5.6)))
- (setq n (sslength setc))
- (setq na (ssname setc 0))
- (setq tp (car(cdr(entget na))));next three lines check for no answer
- (setq tp1(cdr tp))
- (if (= tp1 "LINE")
- (command "insert" "bad" "9.2,6" "" "" "");then
- (progn(setq text (cddr (entget na)));else
- (setq mtl3 (list (strcase (cdr (assoc 1 text)))))
- (if (or(= (car mtl3) "ABSOLUTE")
- (= (car mtl3) "POLAR")
- (= (car mtl3) "RELATIVE")
- )
- (command "insert" "ok" "9.2,6" "" "" "")
- (command "insert" "bad" "9.2,6" "" "" ""));else
- ))
- )
- (a1)
- (a2)
- (a3)
- (REDRAW)
- (Q3)
- )
-
- (defun TQ3 ()
- (setq ans3 (strcase(getstring "\nENTER YOUR ANSWER TO QUESTION #3 <T/F>")))
- (if (= ans3 "T") (PROGN(command "text" "1,4.5" "" "T" )
- (command "insert" "ok" "8.08,5.5" "" "" ""))
- (PROGN(command "text" "1,4.5" "" "F" )
- (command "insert" "bad" "8.08,5.5" "" "" "")))
- (REDRAW)
- (q4)
- );end defun3
-
- (defun Tq4 ()
- (prompt "\nPLEASE READ QUESTION #4 BEFORE ANSWERING")
- (setq ans4 (strcase(getstring "\nENTER YOUR ANSWER TO QUESTION #4 <T/F>")))
- (if (= ans4 "T") (PROGN(command "text" "1,4" "" "T" )
- (command "insert" "ok" "8.08,5" "" "" ""))
- (PROGN(command "text" "1,4" "" "F" )
- (command "insert" "bad" "8.08,5" "" "" "")))
- (REDRAW)
- (q5)
- );end defun4
-
- (defun Tq5 ()
- (prompt "\nPLEASE READ QUESTION #5 BEFORE ANSWERING")
- (setq ans5 (strcase(getstring "\nENTER YOUR ANSWER TO QUESTION #5" )))
- (if (= ans5 "LAYER") (PROGN(command "text" "1,3.5" "" ans5 )
- (command "insert" "ok" "8.08,4.5" "" "" ""))
- (PROGN(command "text" "1,3.5" "" ans5 )
- (command "insert" "bad" "8.08,4.5" "" "" "")))
- (REDRAW)
- (q6)
- );end defun5
-
- (defun tq6 ()
- (prompt "\nPLEASE READ QUESTION #6 BEFORE ANSWERING")
- (setq ans6 (strcase(getstring "\nENTER YOUR ANSWER TO QUESTION #6 <T/F>")))
- (if (= ans6 "F") (PROGN(command "text" "4.8,6" "" "F" )
- (command "insert" "ok" "8.08,4" "" "" ""))
- (PROGN(command "text" "4.8,6" "" "T" )
- (command "insert" "bad" "8.08,4" "" "" "")))
- (REDRAW)
- (q7)
- );end defun6
-
-
-
- (defun q8 ()
- (prompt "\nPLEASE READ QUESTION #8 BEFORE ANSWERING")
- (setq ans8 (strcase(getstring "\nENTER YOUR ANSWER TO QUESTION #8 <T/F>")))
- (if (= ans8 "F") (PROGN(command "text" "4.8,4.5" "" "F" )
- (command "insert" "ok" "8.08,3" "" "" ""))
- (PROGN(command "text" "4.8,4.5" "" "T" )
- (command "insert" "bad" "8.08,3" "" "" "")))
- (REDRAW)
- (q9)
- );end defun8
-
- (defun q9 ()
- (prompt "\nPLEASE READ QUESTION #9 BEFORE ANSWERING")
- (setq ans9 (strcase(getstring "\nENTER YOUR ANSWER TO QUESTION #9" )))
- (if (= ans9 "B") (PROGN(command "text" "4.8,3.9" "" ans9 )
- (command "insert" "ok" "8.08,2.5" "" "" ""))
- (PROGN(command "text" "4.8,3.9" "" ans9 )
- (command "insert" "bad" "8.08,2.5" "" "" "")))
- (REDRAW)
- (q10)
- );end defun9
-
- (defun q10 ()
- (prompt "\nPLEASE READ QUESTION #10 BEFORE ANSWERING")
- (setq ans10 (strcase(getstring "\nENTER YOUR ANSWER TO QUESTION #10 <T/F>")))
- (if (= ans10 "F") (PROGN(command "text" "4.8,3.1" "" "F" )
- (command "insert" "ok" "8.08,2" "" "" ""))
- (PROGN(command "text" "4.8,3.1" "" "T" )
- (command "insert" "bad" "8.08,2" "" "" "")))
- (REDRAW)
- (Q11)
- );end defun10
-
-
-
- (defun c:ldl ()
- (load"lesson2")
- )
- (defun c:el ()
- (command "blue" "lesson2.lsp" )
- )
-