THE PAST MASTER CLUB



CUSTOMIZED AUTO PUNCH.HTM

LABELS FOR INPUT



DIMENSIONS FROM INPUT



SHADED PUNCH



RENDERED AS A SOLID



AUTOLISP SCREW.HTM



(defun kvv()(command "script" "a:\punch"))
(defun tac()
(defun pnch (aa bb cc dd ee ff gg kk)
(setq hh 0.25 x hh)
(defun thred()
;;screw thread
(setq p0 (list (+(- dd ff ee)hh) 0 (/ bb 2.0)))
(setq flg 't tx 0 tn (fix(/ ff  x)) ij 0 tc (/ x 2.0))
(setq p3 (list (+(- dd ff ee)hh) 0 0))
(setq p4 (list (+(- dd ff ee)hh) 0 0))
(command "layer" "m" "5" "c" "4"  "5" "s" "5" "")
;;(while (< ij (*(- tn 3.0)36.0)))
(while flg
(if (< (+ tx hh)  (- dd ee))(setq flg  't)(setq flg  nil))
(setq r1 (+ (/ bb 2.0) x))
(setq tx (+(- dd ff ee)hh(*(/ (+ 0.125 hh) 360.0)ij)))
(setq ty (* (/ bb 2.0) (sin (*(/ ij 180.0)pi))))
(setq tz (* (/ bb 2.0) (cos (*(/ ij 180.0)pi))))
(setq p1 (list tx (* r1 (sin (*(/ ij 180.0)pi))) (* r1 (cos (*(/ ij 180.0)pi)))))
(setq pl (list (- tx tc) ty tz))
(setq  pr (list (+ tx tc) ty tz))
(command "3dface" p0 p1 pl p3 "")
(command "3dface" p0 p1 pr p4 "")
;;(command "pline"  p0  p1 "")
(setq po p0 p0 p1 p3 pl p4 pr ij (+ 10 ij))
))
(print "NICK K. VAN VLIET (416) 921-4653")
(setvar "aperture" 50)(setvar "blipmode" 0)
(setvar "surftab1" 27)(setvar "surftab2" 40)
(command "units" "2" "3" "1" "3" "0" "")
(command "limits" "-200,-200" "200,200")
(command "layer" "t" "*" "m" "3" "c" "3" "3" "s" "3" "")
(command "erase" "c" "-200,-200" "200,200" "")
(command "zoom" "-15,-15" "15,15")                ;;"-2,-2" "12,12"
(command "line" (list 0 (/ aa 2)) (list cc (/ aa 2)) (list cc (/ aa -2))(list 0 (/ aa -2)) "c")
(setq g(- dd(+ ee ff)))(setq h(- dd ee))
(setq i 1.0000)(setq j (/ 1.0000 8.0000))
(command "line" (list g (/ bb 2)) (list h (/ bb 2))
(list h (/ bb -2)) (list g (/ bb -2)) "c")
(setq r(- dd (+ cc ee ff)))
(command "arc" "c" (list g (+ r (/ bb 2))) (list (- g r) (+ r (/ bb 2))) (list g (/ bb 2)))
;;(setq kvv (entget(entlast)))
;;(terpri)(princ kvv)
(command "arc" "c" (list g (- (/ bb -2) r)) (list g (/ bb -2)) (list (- g r) (- (/ bb -2) r)))
;;(setq hvv (entget(entlast)))
;;(terpri)(princ hvv)
(command "circle" (list (- dd gg) 0) gg)
(command "line" "tan" (list (- dd gg) gg) "end" (list (- dd ee) (/ bb 2)) "")
(setq kvv (entget(entlast)))
(setq pnt (cdr(assoc 10 kvv)))
(setq pntf (cdr(assoc 11 kvv)))
;;(terpri)(princ pnt)(terpri)(princ pntf)(terpri)(getreal "enter")
(command "line" "tan" (list (- dd gg) (/ gg -1)) "end" (list (- dd ee) (/ bb -2)) "")
(command "plan" "")
(command "trim" "c" (list (- dd ee) (/ bb 2)) (list  dd  0.1) "c" (list (- dd
ee) (/ (- bb) 2)) (list (- dd) 0.1) "" (list (- dd (* 2 gg)) 0) "")
(command "layer" "t" "*" "m" "1" "c" "1" "1" "")
(command "line" (list (/ j -1) 0)(list (+ dd j) 0) "")
(command "Change" "last" "" "prop" "lt" "center" "")
(command "layer" "s" "1" "lt" "center" "1" "")
(command "zoom" "e" "zoom" "0.5x")
;;1st dim vert "A"
(setq ii(/ i -1))(setq jj(/ j -1))
(command "layer" "t" "*" "m" "4" "c" "4" "4" "")
(command "line" (list (+ ii ii) (/ aa -2)) (list (+ ii ii) (/ aa 2)) "")
(command "line" (list (+ ii ii jj) (/ aa 2)) (list jj (/ aa 2)) "")
(command "line" (list (+ ii ii jj) (/ aa -2)) (list jj (/ aa -2)) "")
(command "layer" "m" "2" "c" "2" "2" "s" "2" "")
(command "text" (list (+ ii ii j) 0) '0.3 '0 "A%%c")        ;;DIA!
;;2nd dim vert "B"
(command "layer" "m" "4" "s" "4" "")
(command "line" (list (+ i dd) (/ bb -2)) (list (+ i dd) (/ bb 2)) "")
(command "line" (list (+ h j) (/ bb 2))(list (+ dd i j) (/ bb 2)) "")
(command "line" (list (+ h j) (/ bb -2))(list (+ dd i j) (/ bb -2)) "")
(command "layer" "m" "2" "s" "2" "")
(command "text" (list (+ dd i j) 0) '0.3 '0 "B DIA.")
;;3rd dim hor "C"
(command "layer" "s" "4" "")
(command "line" (list 0 (+ (/ aa 2) i)) (list cc (+ (/ aa 2) i)) "")
(command "line" (list cc (+ j (/ aa 2))) (list cc (+ i j (/ aa 2))) "")
(command "layer" "s" "2" "")
(command "text" (list (/ cc 2) (+ (/ aa 2) i j)) '0.3 '0 "C")
;;4th dim hor "D"
(command "layer" "s" "4" "")
(command "line" (list 0 (+ (/ aa 2) i i)) (list dd (+ (/ aa 2) i i)) "")
(command "line" (list 0 (+ j (/ aa 2))) (list 0 (+ i i j (/ aa 2))) "")
(command "line" (list dd  j) (list dd (+ i i j (/ aa 2))) "")
(command "layer" "s" "2" "")
(command "text" (list (/ dd 2) (+ (/ aa 2) i i j)) '0.3 '0 "D")
;;5th dim hor "E"
(command "layer" "s" "4" "")
(command "line" (list h (+ (/ bb 2) i)) (list dd (+ (/ bb 2) i)) "")
(command "line" (list h (+ j (/ bb 2))) (list h (+ i j (/ bb 2))) "")
(command "layer" "s" "2" "")
(command "text" (list (+ h (/ ee 2)) (+ (/ bb 2) i j)) '0.3 '0 "E")
;;6th dim hor "F"
(command "layer" "s" "4" "")
(command "line" (list g (+ (/ bb 2) i)) (list h (+ (/ bb 2) i)) "")
(command "line" (list g (+ j (/ bb 2))) (list g (+ i j (/ bb 2))) "")
(command "layer" "s" "2" "")
(command "text" (list (+ g (/ ff 2)) (+ (/ bb 2) i j)) '0.3 '0 "F")
;;6th dim hor "G"
(command "layer" "s" "4" "")
(command "line" "perp,end" (list (- dd 0.2) 0.4) (list (+ dd ee) (+ (/ bb 2) i)) "")
(setq e(entlast))(setq pnt1 (cdr(assoc 10 (entget e))))
(command "line" (list (+ dd ee) (+ (/ bb 2) i))(list (+ dd ee j) (+ (/ bb 2) i)) "")
(command "layer" "s" "2" "")
(command "text" (list (+ dd ee j j) (+ (/ bb 2) i (/ j -1))) '0.3 '0 "G RAD.")
(setvar "dimclrt" 2)(setvar "dimclre" 4)(setvar "dimclrd" 4)
;(setvar "dimstyle" "romans")
(setvar "dimtih" 0)(setvar "dimtoh" 0)
(setvar "dimtad" 0)(setvar "dimdli" 1)(setvar "dimrnd" 3)(setvar "dimlim" 3)
(setvar "dimtp" 0.003)(setvar "dimtm" 0.001)
(if (= kk 1) 
 (progn (setq l(getreal "Want dimentions?  "))
   (command "layer" "s" "4" "f" "*" "t" "2" "")
   (command "erase" "c" "-100,-100" "100,100" "")
   (command "layer" "t" "*" "s" "4" "" "zoom" "e" "zoom" "0.5x")
   (command "regen" "dim" "linear"
   "vert" (list 0 (/ aa -2)) (list 0 (/ aa 2)) (list ii 0) ""
   "vert" (list h (/ bb -2)) (list h (/ bb 2)) (list (+ dd i) 0) ""
   "hor"  (list 0 (/ aa 2)) (list cc (/ aa 2)) (list 0 (+ (/ aa 2) i i)) ""
   "base" (list dd 0) ""
   (setvar "dimdli" 0)(setvar "dimtix" 1)(setvar "dimsoxd" 0)
   "hor" (list dd 0) (list h (/ bb 2)) (list h (+ i (/ bb 2))) ""
   "cont" (list g (/ bb 2)) ""
   (setvar "dimtix" 0)
   "leader" "perp,end" (list (- dd 0.2) 0.4) (list (+ dd 1) (+ (/ bb 2) i))
                    (list (+ dd 1 j) (+ (/ bb 2) i)) "" (rtos gg 2 3) ^c^c)
 )
)
(command "layer" "t" "*" "s" "3" "" "zoom" "e" "zoom" "0.9x")
)
(pnch 2.000 1.000 1.000 8.000 1.000 5.500 0.250 0)
(defun ques()
(pnch
(getreal "New punch head dia.? A: ")
(getreal "New punch shank dia.? B: ")
(getreal "New punch head height.? C: ")
(getreal "New punch length.? D: ")
(getreal "New punch nipple length.? E: ")
(getreal "New punch shank length.? F: ")
(getreal "New punch nipple radius.? G: ")
;;;(getreal "New screw thread height.? H: ")
1)
)(ques)
(setq aa 3 bb 2 cc 1 dd 9 ee 1 ff 6.75 gg 0.23)
(thred)
(print "hit enter")
(read-line)
(command "layer" "s" "3" "f" "4" "")
(command "pline" (list 0 0) (list 0 (/ aa 2.000)) (list cc (/ aa 2.000))
(list cc (-(/ aa 2.000)(-(/(- aa bb)2.000)r))) "a" (list(+ cc r) (/ bb 2.000)) "")
(command "pline" (list (+ cc r) (/ bb 2)) pntf pnt "a" (list dd 0) "")
(command "pedit" pnt "j" pnt "0,0.1" "" "")
(command "revsurf" "0,0.5,0" (list (* 2 cc) 0) "" "")
;;(command "rotate3d" "w" "-200,-200" "200,200" "" "y" "0,0,0" "r" "" "-10")
;;(command "rotate3d" "w" "p" "" "x" "0,0,0" "r" "" "15")
;;(command "vpoint" "-2,-30,40")
;;(command "vpoint" "-2,-3,1")
(command "vpoint" "13.7,-26.8,40.0")
(command "zoom" "e")
(command "shade")                                        ;;;ok ==punch.lst
;;;(command "_render" "" "");;;no such command
;;;(print "hit enter")
;;;(read-line)
(setq l "Tried? A=3 B=2 C=1 D=9 E=1 F=6.75 G=0.25")
)(tac)


HOME PAGE

1