(defun setgp (pl)
; To select the size of the Guild Pin.
   (if (< pl 210)  (setq SOGP 20))
   (if (AND (>= pl 210)  (< pl 260))  (setq sogp 25))
   (if (AND (>= pl 260)  (< pl 360))  (setq sogp 30))
   (if (AND (>= pl 360)  (< pl 410))  (setq sogp 35))
   (if (AND (>= pl 410)  (< pl 510))  (setq sogp 40))
   (if (AND (>= pl 510)  (< pl 660))  (setq sogp 50))
   (if (AND (>= pl 660)  (< pl 760))  (setq sogp 60))
   (if (AND (>= pl 760)  (< pl 910))  (setq sogp 70))
   (if (>= pl 910) (setq sogp 80))
      
; To select the size of the Return Pin.
   (if (= sogp 20)  (setq sandp 12))
   (if (= sogp 25)  (setq sandp 15))
   (if (= sogp 30)  (setq sandp 20))
   (if (= sogp 35)  (setq sandp 25))
   (if (or (= sogp 40)  (= sogp 50) (= sogp 60))  (setq sandp 30))
   (if (>= sogp 70)  (setq sandp 35)) 
 )

(defun setrp (sandp sogp scrwb scrwe)
 ;设置回针位置. 
   (if (= sandp 12) (setq rpd_x 19 rpd_y 16))
   (if (= sandp 15) (setq rpd_x 25 rpd_y 19))
   (if (= sandp 20) (setq rpd_x 26 rpd_y 23))
   (if (= sandp 25) (setq rpd_x 30 rpd_y 25))
   (if (= sandp 30) (setq rpd_x 35 rpd_y 33))
   (if (= sandp 35) (setq rpd_x 40 rpd_y 38))
   (if (= sandp 40) (setq rpd_x 45 rpd_y 43))
   (if (= sandp 50) (setq rpd_x 55 rpd_y 53))
   (if (= sandp 0.5) (setq rpd_x 24 rpd_y 20)) 
   (if (= sandp 0.625) (setq rpd_x 29 rpd_y 19))
   (if (= sandp 0.75) (setq rpd_x 28 rpd_y 23))
   (if (= sandp 0.875) (setq rpd_x 30 rpd_y 22)) 
   (if (= sandp 1) (setq rpd_x 36 rpd_y 25))
   (if (= sandp 1.25) (setq rpd_x 36 rpd_y 32))
 ;设置针板杯头位置.
   (setq scrw_c (cond ((= scrwe  6)  7) ((= scrwe 0.25) 7)
                      ((= scrwe  8) 10) ((= scrwe 0.312) 10)
                      ((= scrwe 10) 12) ((= scrwe 0.375) 10)
                      ((= scrwe 12) 13) ((= scrwe 0.5) 13)
                      ((= scrwe 14) 14)
                      ((= scrwe 16) 16)
    )   )
 ;设置锁B板杯头位置.
   (if (and (= sogp 20)(= scrwb 12)) (setq scrw_cx 51 scrw_cy 20)) 
   (if (and (= sogp 20)(= scrwb 14)) (setq scrw_cx 52 scrw_cy 22.5))
   (if (= sogp 25) (setq scrw_cx 60 scrw_cy 25) )
   (if (and (= sogp 30)(= scrwb 14)) (setq scrw_cx 68 scrw_cy 30)) 
   (if (and (= sogp 30)(= scrwb 16)) (setq scrw_cx 69 scrw_cy 30))
   (if (= sogp 35) (setq scrw_cx 78 scrw_cy 35))
   (if (= sogp 40) (setq scrw_cx 87 scrw_cy 40))
   (if (= sogp 45) (setq scrw_cx 94 scrw_cy 45))
   (if (= sogp 50) (setq scrw_cx 104 scrw_cy 50))
   (if (= sogp 60) (setq scrw_cx 120 scrw_cy 60))
   (if (= sogp 70) (setq scrw_cx 136 scrw_cy 70))
   (if (= sogp 80) (setq scrw_cx 151 scrw_cy 80))
   (if (= sogp 0.75) (setq scrw_cx 51 scrw_cy 20))
   (if (= sogp 0.875) (setq scrw_cx 56 scrw_cy 25))
   (if (= sogp 1) (setq scrw_cx 60 scrw_cy 30))
   (if (= sogp 1.25) (setq scrw_cx 74 scrw_cy 35))
   (if (= sogp 1.5) (setq scrw_cx 85 scrw_cy 40))
 )
