(defun c:sprueb()
(setq TYP(getstring "\A type  or B type? "))
(setq L(getreal "\n enter Sprue length: "))
(setq W(getreal "\n enter Sprue diameter: "))
(setq A2(getreal "\n enter Sprue angle: "))
(setq A1(* (/ (+ A2 270) 180) pi))
(setq R1(getreal "\n enter Nozzle radious: "))
(setq R(+ R1 1))
(setq B1(getreal "\n enter Nozzie hole diameter: "))
(setq p1(getpoint "\n enter Insert point: "))
(setq p(list (car p1) (+ 5 (cadr p1))))
(setq p1(list (car p) (+ (cadr p) (- R 3))))
(setq p2(list (- (car p) (sqrt (- (* R R) (* (- R 3) (- R 3)))))
(cadr p)))
(setq p3(list (+ (car p) (sqrt (- (* R R) (* (- R 3) (- R 3)))))
(cadr p)))
(setq p4(list (+ (car p) 25) (cadr p)))
(setq p5(list (car p4) (- (cadr p4) 5)))
(setq p6(list (+ (car p5) 4) (cadr p5)))
(setq p7(list (car p6) (- (cadr p6) 15)))
(setq p8(list (- (car p7) (- 29 (/ W 2))) (cadr p7)))
(setq p9(list (car p8) (- (cadr p8) L)))
(setq p10(list (+ (car p1) (/ B1 2))
(- (cadr p1) (sqrt (- (* R R) (* (/ B1 2) (/ B1 2)))))))
(command "line" (list (car p) (+ (cadr p) 3))
(list (car p) (- (cadr p9) 3)) "")
(command "line" (list (- (car p) 25) (cadr p)) p4 "")
(if (= TYP "a") (setq TYP "A"))
(if (= TYP "A")
(progn
(command "pline" "@"
(polar (getvar "lastpoint") (* 1.5 pi) 20) p8 p9 ""))
(progn
(command "pline" p4 p5 p6 p7 p8 p9 "")))
(command "mirror" "l" "" p p1 "")
(command "arc" "c" p1 p2 p3)
(command "line" p10 (polar p10 A1 (/ (- (cadr p9) (cadr p10))
(sin A1))) "")
(command "mirror" "l" "" p p1 "")
)
