(defun c:spring()
(setq F (getvar "blipmode")) (setvar "blipmode" 0)
(setq p (getpoint "Insert point:"))
(prompt "\n Diameter = 4~6,8,10,12,14,16,(20 step 5~105),(110 step 10~200)")
(setq D (getreal "\n Enter ejector return pin diameter :"))
(setq L (getdist "Enter spring length:"))
(setq ds ( + d 4.75))
(setq dt d)
(setq d (+ (* d 0.125) 1.75))
(setq dh ( + dt 10))
(setq p1 (polar p pi (/ Ds 2)))
(setq p2 (polar p 0 (/ Ds 2)))
(setq p3 (polar p1 (/ pi 2) (/ d 2)))
(setq p4 (polar p2 (/ pi 2) d))
(setq p5 (polar p1 (/ pi 2) L))
(setq p6 (polar p2 (/ pi 2) (- L (/ d 2))))
(setq p7 (polar p5 (/ pi -2) d))
(setq p8 (polar p7 pi (/ d 2)))
(setq p9 (polar p7 0 (/ d 2)))
(setq p10 (polar p6 pi (/ d 2)))
(setq p11 (polar p6 0 (/ d 2)))
(setq p12 (polar p3 pi (/ d 2)))
(setq p13 (polar p3 0 (/ d 2)))
(setq p14 (polar p4 pi (/ d 2)))
(setq p15 (polar p4 0 (/ d 2)))
(setq p16 (polar p3 (+ (angle p3 p4) (/ pi 2)) (/ d 2)))
(setq p17 (polar p3 (- (angle p3 p4) (/ pi 2)) (/ d 2)))
(setq p18 (polar p4 (+ (angle p3 p4) (/ pi 2)) (/ d 2)))
(setq p19 (polar p4 (- (angle p3 p4) (/ pi 2)) (/ d 2)))
(setq p20 (polar p7 (+ (angle p3 p4) (/ pi 2)) (/ d 2)))
(setq p21 (polar p7 (- (angle p3 p4) (/ pi 2)) (/ d 2)))
(setq p22 (polar p6 (+ (angle p3 p4) (/ pi 2)) (/ d 2)))
(setq p23 (polar p6 (- (angle p3 p4) (/ pi 2)) (/ d 2)))
(setq p24 (polar p2 pi (/ d 2)))
(setq p25 (polar p2 0 (/ d 2)))
(setq p26 (polar p5 pi (/ d 2)))
(setq p27 (polar p5 0 (/ d 2)))
(setq p28 (polar p pi (/ Dh 2)))
(setq p29 (polar p 0 (/ Dh 2)))
(setq p30 (polar p29 (/ pi 2) L))
(setq p31 (polar p28 (/ pi 2) L))
(command "circle" p3 "D" d)
(command "circle" p4 "D" d)
(command "circle" p6 "D" d)
(command "circle" p7 "D" d)
(command "arc" p25 "C" p2 p24)
(command "arc" p26 "C" p5 p27)
(command "line" p17 p19 "")
(command "line" p16 p18 "")
(command "line" p20 p22 "")
(command "line" p21 p23 "")
(command "line" p8 p12 "")
(command "line" p9 p13 "")
(command "line" p10 p14 "")
(command "line" p11 p15 "")
(command "line" p29 p30 p31 p28 "")
(setvar "blipmode" F))
