(defun C:retp ()
(menucmd "s=osnapb")
(setq p (getpoint"\nPlease insert the point:"))
(menucmd "s=osnapb")
(setq D (getreal"\nPlease select the diameter size '12' '15' '20' '25' '30' '35':"))
(menucmd "s=osnapb")
(setq L1 (getdist p "\nPlease digit top point:"))
(menucmd "s=osnapb")
(setq L2 (getdist p "\nPlease digit end point:"))
(setq A (getreal"\nPlease enter the return pin locating angle:"))
(menucmd "s=s")
(setq B (* pi (/ A 180)))
(cond ((= D 12)
       (setq d1 17 h 8 h1 3)
      )
      ((= D 15)
       (setq d1 20 h 8 h1 3)
      )
      ((= D 20)
       (setq d1 25 h 8 h1 3)
      )
      ((= D 25)
       (setq d1 30 h 8 h1 3)
      )
      ((= D 30)
       (setq d1 35 h 8 h1 3)
      )
      ((= D 35)
       (setq d1 40 h 8 h1 3)
      )
      (t)
)
(setq p1 (polar p B L1))
(setq p2 (polar p (+ B pi) L2))
(setq p4 (polar p2 B h))
(setq p3 (polar p2 B (+ h h1)))
(setq p5 (polar p1 (- B (/ pi 2))(/ D 2)))
(setq p6 (polar p3 (- B (/ pi 2))(/ D 2)))
(setq p7 (polar p4 (- B (/ pi 2))(/ D 2)))
(setq p8 (polar p4 (- B (/ pi 2))(/ d1 2)))
(setq p9 (polar p8 (- B (/ pi 2)) 0.5))
(setq p10 (polar p2 (- B (/ pi 2))(/ d1 2)))
(setq p11 (polar p10 (- B (/ pi 2)) 0.5))
(setq p12 (polar p1 (+ B (/ pi 2))(/ D 2)))
(setq p13 (polar p3 (+ B (/ pi 2))(/ D 2)))
(setq p14 (polar p4 (+ B (/ pi 2))(/ D 2)))
(setq p15 (polar p4 (+ B (/ pi 2))(/ d1 2)))
(setq p16 (polar p15 (+ B (/ pi 2)) 0.5))
(setq p17 (polar p2 (+ B (/ pi 2))(/ d1 2)))
(setq p18 (polar p17 (+ B (/ pi 2)) 0.5))
(setq p19 (polar p3 (- B (/ pi 2))(/ (- (/ D 2) 0.5))))
(setq p20 (polar p4 (- B (/ pi 2))(/ (- (/ D 2) 0.5))))
(setq p21 (polar p3 (+ B (/ pi 2))(/ (- (/ D 2) 0.5))))
(setq p22 (polar p4 (+ B (/ pi 2))(/ (- (/ D 2) 0.5))))
(command "line" p5 p6 p7 p8 p9 p11 "")
(command "line" p12 p13 p14 p15 p16 p18 "")
(command "line" p8 p10 "")
(command "line" p15 p17 "")
(command "line" p19 p20 "")
(command "line" p21 p22 "")
(command "line" p9 p16 "")
(command "line" p6 p13 "")
)
