(defun C:lp-a()
(setq P (getpoint "Please insert point:"))
(setq D (getint "\n Please select the diameter size '16' '20' '25' '30' '35'
'40' '50' '60':"))(setq L (getint "Please input the cav. plate thinkness:"))
(setq L1 (getint "Please input the core plate thinkness:"))
(setq A (getreal "Please input the leading pin angle:"))
(setq B (* pi (/ A 180)))
(cond
    ((= d 16)
    (setq d1 20 h 6 m 8))
    ((= d 20)
    (setq d1 25 h 6 m 10))
    ((= d 25)
    (setq d1 30 h 8 m 12))
    ((= d 30)
    (setq d1 35 h 8 m 15))
    ((= d 35)
    (setq d1 40 h 8 m 15))
    ((= d 40)
    (setq d1 45 h 10 m 20))
    ((= d 50)
    (setq d1 56 h 12 m 25))
    (t
    (setq d1 66 h 15 m 25))
)
(setq p1 (polar p (+ B pi)(- L1 H)))
(setq p2 (polar p1 B 4))
(setq p3 (polar p2 (+ B (/ pi 2))(- (/ D 2.0) 0.5)))
(setq p4 (polar p2 (- B (/ pi 2))(- (/ D 2.0) 0.5)))
(setq p5 (polar p2 (+ B (/ pi 2))(/ D 2.0)))
(setq p6 (polar p2 (- B (/ pi 2))(/ D 2.0)))
(setq p9 (polar p1 (+ B (/ pi 2))(/ D1 2)))
(setq p10 (polar p1 (- B (/ pi 2))(/ D1 2)))
(setq p11 (polar p9 (+ B pi) H))
(setq p12 (polar p10 (+ B pi) H))
(setq p7 (polar p (+ B (/ pi 2))(/ D 2.0)))
(setq p8 (polar p (- B (/ pi 2))(/ D 2.0)))
(setq p13 (polar p1 (+ B (/ pi 2))(- (/ D 2.0) 0.5)))
(setq p14 (polar p1 (- B (/ pi 2))(- (/ D 2.0) 0.5)))
(command "break" p7 p8)
(command "line" p11 p12 p10 p9 "c")
(command "line" p5 p6 p8 p7 "c")
(command "line" p3 p13 "")
(command "line" p4 p14 "")
(setq p15 (polar p B (- L 2)))
(setq p16 (polar p B (- L (+ 2 M))))
(setq p28 (polar p16 B 1.5))
(setq p24 (polar p16 (- B (/ pi 2))(/ D 2.0)))
(setq p25 (polar p16 (+ B (/ pi 2))(/ D 2)))
(setq p27 (polar p24 (+ B 0.087266)(/ M (cos 0.087266))))
(setq p26 (polar p25 (- B 0.087266)(/ M (cos 0.087266))))
   (if (>= (- L (+ 3 M)) D)
    (progn
     (setq N (/ (- L(+ 2 M)) D))
     (setq X 1)
      (repeat N
       (setq p17 (polar p28 (+ B pi)(* X D)))
       (setq p18 (polar p17 (+ B (/ pi 2))(/ D 2.0)))
       (setq p19 (polar p17 (- B (/ pi 2))(/ D 2.0)))
       (setq p20 (polar p19 B 1.5))
       (setq p21 (polar p18 B 1.5))
       (setq p22 (polar p19 (+ B pi) 1.5))
       (setq p23 (polar p18 (+ B pi) 1.5))
       (command "line" (polar p21 B (- D 3.0)) p21 p20
       (polar p20 B (- D 3.0)) "")
       (command "arc" p20 "c" p19 p22)
       (command "line" p22 p23 "")
       (command "arc" p23 "c" p18 p21)
       (setq X (+ 1 X)))
     (command "line" p23 p7 "")
    (command "line" p22 p8 ""))
(command "line" p7 p25 p24 p8 ""))
(command "pline" p24 "w" 0 0 p27 p26 p25 "")
(command "fillet" "R" 3.0 "fillet" "P" "L")
(command "line" p24 p25 "")
)
