;Reduced Target program ;started November 28, 2010 ;by Ray Brandes - Ray-Vin.Com (defun c:go() ;(setq tgt "sr" rd 50 lw 0.03 bul 0.22) ;used for debugging (getuser) (if (eq tgt "sr") (setq tgt SR)) (if (eq tgt "sr3") (setq tgt SR3)) (if (eq tgt "mr1") (setq tgt MR1)) (calc) ) ;caculate & draw rings (defun calc () (foreach n tgt (if (listp n) (if (eq 1 (nth 2 n)) (setq blk (nth 1 n)) ))) (setq blk (/ blk (/ (float (last tgt)) rd))) ;first ring is X ring (setq od (- (/ (+ (nth 1 (assoc "X" tgt)) bul) (/ (last tgt) rd)) bul) id 0) (command "donut" id od "0,0" "") (setq ctr 1) (while (< ctr 7) (setq lst (nth ctr tgt)) (setq oldod od) (setq od (- (/ (+ (nth 1 lst) bul) (/ (last tgt) rd)) bul) id 0) (if (eq 1 (nth 2 lst)) (progn ; is black (setq id (+ oldod (* 2 lw))) (setq aimid (+ od (* 2 lw))) (princ aimid) ) (progn ; is white (setq id (- od (* 2 lw))) ) ) (command "donut" id od "0,0" "") (setq ctr (1+ ctr)) ) (command "text" "J" "C" (strcat "0," (rtos (* 0.6 od))) 0.2 0 (strcat "Five ring to measure " (rtos od))) ;aiming black (command "donut" aimid blk "0,0" "") );end calc (defun getuser() (while (progn (setq tgt (strcase (getstring "SR, SR3, or MR1? ") T)) (not (or (eq tgt "sr")(eq tgt "sr3")(eq tgt "mr1"))) ;valid target chosen )) (setq rd (getint "Reduced Distance in yards? ")) (setq lw (getreal "Line Width? ")) (setq bul (getreal "Bullet Diameter? ")) ) ;target name, ring number, inner, outter, color (setq SR (list (list "X" 3 1) ;black (list "10" 7 1) ;black (list "9" 13 1) ;black and aiming size (list "8" 19 0) (list "7" 25 0) (list "6" 31 0) (list "5" 37 0) 200 )) (setq SR3 (list (list "X" 3 1) ;black (list "10" 7 1) ;black (list "9" 13 1) ;black (list "8" 19 1) ;black and aiming size (list "7" 25 0) (list "6" 31 0) (list "5" 37 0) 300 )) (setq MR1 (list (list "X" 6 1) ;black (list "10" 12 1) ;black (list "9" 18 1) ;black (list "8" 24 1) ;black (list "7" 36 1) ;black and aiming size (list "6" 48 0) (list "5" 60 0) 600 ))