 (defun c:ap ()
;(IF (= (TYPE F1) 'FILE ) "YES"  (STOP))
;(IF (= (TYPE F2) 'FILE ) "YES" (STOP))

 (defun setup()
   (setq ch (getstring "\n D(12)D(15)D(20)D(25)D(30) ?"))

   (setq L (getreal "\n How about the A.P longer ?"))

   (setq base (getpoint "\n Where will you put on the A.P ?"))
   (setq x1 (eval (car base)))
   (setq y1 (eval (cadr base)))

   (setvar "cmdecho" 1)
   (while (or (eq ch "12") (eq ch "D12") (eq ch "d12")) (D12))
   (while (or (eq ch "15") (eq ch "D15") (eq ch "d15")) (D15))
   (while (or (eq ch "20") (eq ch "D20") (eq ch "d20")) (D20))
   (while (or (eq ch "25") (eq ch "D25") (eq ch "d25")) (D25))
   (while (or (eq ch "30") (eq ch "D30") (eq ch "d30")) (D30))
   (setup)
 )

 (defun D12()
   (setq d 12)
   (setq h 10)
   (setup1)
 )

 (defun D15()
   (setq d 15)
   (setq h 12)
   (setup1)
 )

 (defun D20()
   (setq d 20)
   (setq h 15)
   (setup1)
 )

 (defun D25()
   (setq d 25)
   (setq h 15)
   (setup1)
 )

 (defun D30()
   (setq d 30)
   (setq h 15)
   (setup1)
 )

(defun setup1()
   (setq b (+ d 5))
   (if (< l 0) (setq d (* -1 d)))
   (if (< l 0) (setq h (* -1 h)))
   (setq b1 (/ b 2))
   (setq r (/ d 2))
   (setq e (- l r))

   (setq p1 (list (- x1 b1) y1))
   (setq p2 (list (+ x1 b1) y1))
   (setq p3 (list (+ x1 b1) (+ y1 h)))
   (setq p4 (list (- x1 b1) (+ y1 h)))
   (command "pline" p1 "w" "0" "0" p2 p3 p4 p1 "")

   (setq p5 (list (+ x1 r) (+ y1 h)))
   (setq p6 (list (+ x1 r) (+ y1 e)))
   (setq p78 (list x1 (+ y1 l)))
   (setq p9 (list (- x1 r) (+ y1 e)))
   (setq p10 (list (- x1 r) (+ y1 h)))
   (command "pline" p5 p6 "A" p78 p9 "L" P10 "")
   (setup)
 )
   (setup)
 )
