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

 (defun setup()
   (setq ch (getstring "\n
    M(3)(4)(5)(6)(8)(10)(12)(16)(20)(22)(24)(30)(36)(42)(48)?"))

   (setq l (getdist "\n How about the screw longer ?"))

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

   (setvar "cmdecho" 1)
   (while (or (eq ch "3") (eq ch "M3") (eq ch "m3")) (m3))
   (while (or (eq ch "4") (eq ch "M4") (eq ch "m4")) (m4))
   (while (or (eq ch "5") (eq ch "M5") (eq ch "m5")) (m5))
   (while (or (eq ch "6") (eq ch "M6") (eq ch "m6")) (m6))
   (while (or (eq ch "8") (eq ch "M8") (eq ch "m8")) (m8))
   (while (or (eq ch "10") (eq ch "M10") (eq ch "m10")) (m10))
   (while (or (eq ch "12") (eq ch "M12") (eq ch "m12")) (m12))
   (while (or (eq ch "16") (eq ch "M16") (eq ch "m16")) (m16))
   (while (or (eq ch "20") (eq ch "M20") (eq ch "m20")) (m20))
   (while (or (eq ch "22") (eq ch "M22") (eq ch "m22")) (m22))
   (while (or (eq ch "24") (eq ch "M24") (eq ch "m24")) (m24))
   (while (or (eq ch "30") (eq ch "M30") (eq ch "m30")) (m30))
   (while (or (eq ch "36") (eq ch "M36") (eq ch "m36")) (m36))
   (while (or (eq ch "42") (eq ch "M42") (eq ch "m42")) (m42))
   (while (or (eq ch "48") (eq ch "M48") (eq ch "m48")) (m48))
 )

 (defun m3()
;  (setq a1 5.5)
   (setq b 3)
   (setq d 0.5)
   (setup1)
 )
 (defun m4()
;  (setq a1 7)
   (setq b 4)
   (setq d 0.7)
   (setup1)
 )
 (defun m5()
;  (setq a1 8.5)
   (setq b 5)
   (setq d 0.8)
   (setup1)
 )

 (defun m6()
;  (setq a1 10)
   (setq b 6)
   (setq d 1.00)
   (setup1)
 )

 (defun m8()
;  (setq a1 13)
   (setq b 8)
   (setq d 1.25)
   (setup1)
 )

 (defun m10()
;  (setq a1 16)
   (setq b 10)
   (setq d 1.50)
   (setup1)
 )

 (defun m12()
;  (setq a1 18)
   (setq b 12)
   (setq d 1.75)
   (setup1)
 )

 (defun m16()
;  (setq a1 24)
   (setq b 16)
   (setq d 2.00)
   (setup1)
)

(defun m20()
;  (setq a1 28)
   (setq b 20)
   (setq d 2.50)
   (setup1)
 )

 (defun m22()
;  (setq a1 30)
   (setq b 22)
   (setq d 2.500)
   (setup1)
 )

 (defun m24()
;  (setq a1 33)
   (setq b 24)
   (setq d 3.00)
   (setup1)
 )

 (defun m30()
;  (setq a1 42)
   (setq b 30)
   (setq d 3.50)
   (setup1)
 )

 (defun m36()
;  (setq a1 50)
   (setq b 36)
   (setq d 4.00)
   (setup1)
)

 (defun m42()
;  (setq a1 63)
   (setq b 42)
   (setq d 4.50)
   (setup1)
)

 (defun m48()
;  (setq a1 72)
   (setq b 48)
   (setq d 5.00)
   (setup1)
)

(defun setup1()
 ;  (setq a (/ a1 2))
   (if (< l 0) (setq b (* -1 b)))
   (setq c (/ b 2))
   (if (< l 0) (setq d (* -1 d)))
   (setq e (- c d))
   (setq f (- l c))
   (setq g (* 0.57735 e))
;;  (if (< l 0) (setq g (* -1 g)))
   (setq gl (+ g l))
;  (setq p1 (list (- x1 a) y1))
;  (setq p2 (list (+ x1 a) y1))
;  (setq p3 (list (+ x1 a) (+ y1 b)))
;  (setq p4 (list (- x1 a) (+ y1 b)))
;  (command "pline" p1 "w" "0" "0" p2 p3 p4 p1 "")

   (setq p5 (list (+ x1 c) (+ y1 0)))
   (setq p6 (list (+ x1 c) (+ y1 f)))
   (setq p7 (list (- x1 c) (+ y1  f)))
   (setq p8 (list (- x1 c) (+ y1 0)))
   (command "pline" p5 "w" "0" "0" p6 p7 p8 p5 "")

   (setq p9 (list (+ x1 e) (+ y1 0)))
   (setq p10 (list (+ x1 e) (+ y1 l)))
   (setq p11 (list (- x1 e) (+ y1 l)))
   (setq p12 (list (- x1 e) (+ y1 0)))
   (command "pline" p9 "w" "0" "0" p10 p11 p12 "")

;  (setq p13 (list (- x1 c) (+ y1 b g)))
;  (setq p14 (list (+ x1 c) (+ y1 b g)))
   (setq p20 (list (+ x1 0) (+ y1 gl)))
;  (command "line" p13 p14 "")
;  (command "line" p6 p10 "")
;  (command "line" p7 p11 "")
   (command "pline" p10 "w" "0" "0" p20 p11 "")
   (setup)
 )
   (setup)
 )
