home *** CD-ROM | disk | FTP | other *** search
- ;*****************************************
- ;* The program for drawing screw hole. *
- ;*****************************************
- (setq dr (getreal "\n╩Σ ╚δ ╓▒ ╛╢=: "))
- (setq dgch " ")
- (setq yn (getstring "\n╙╨ ┼Σ ║╧ ╛½ ╢╚ ╖±(N)? "))
- (if (or (= yn "y") (= yn "Y"))(setq dgch (getstring "\n╩Σ ╚δ ┼Σ ║╧ ╛½ ╢╚: ")))
- (setq h (getreal "\n╩Σ ╚δ ╢ñ ┐╫ ╔ε ╢╚=: "))
- (setq dgl 0. dgr 0.)
- (setq dr1 dr dl1 dr l1 h dgl1 dgl dgr1 dgr)
- (setq dr (* (/ dr 2) s) h (* h s))
- (setq m1 0 dl dr)
- (if (or (= sc 1) (= sc 4))(setq m1 1))
- (if (or (= sc 2) (= sc 5))(setq m1 2))
- (if (or (= sc 1) (= sc 2))(setq kd dl))
- (if (= sc 4)(setq kd (- 0 dl)))
- (setq topl (list 0 0) botl (list 0 0) tof (list 0 0) bof (list 0 0))
- (setq botr (list 0 0) toe (list 0 0) boe (list 0 0))
- (if (or (= sc 4) (= sc 5))(setq h (- 0 h) dgl (- 0 dgl) dgr (- 0 dgr)))
- (if (= m1 1)(progn
- (setq topl (list xg (+ yb l dl)))
- (setq botl (list xg (- (+ yb l) dl)))
- (setq tof (list xg (- (+ yb l dl) s)))
- (setq bof (list xg (- (+ yb l s) dl)))
- (setq toe (list (+ xg h kd) (- (+ yb l dl) s)))
- (setq boe (list (+ xg h kd) (- (+ yb l s) dl)))
- (setq topr (list (+ xg h) (+ yb l dr)))
- (setq botr (list (+ xg h) (- (+ yb l) dr)))
- (setq ept (list (+ xg h kd (* 0.577 kd)) (+ yb l)))
- ))
- (if (= m1 2)(progn
- (setq topl (list (+ x1 l dl) yf))
- (setq botl (list (- (+ x1 l) dl) yf))
- (setq tof (list (- (+ x1 l dl) s) yf))
- (setq bof (list (- (+ x1 l s) dl) yf))
- (setq toe (list (- (+ x1 l dl) s) (- yf h kd)))
- (setq boe (list (- (+ x1 l s) dl) (- yf h kd)))
- (setq topr (list (+ x1 l dr) (- yf h)))
- (setq botr (list (- (+ x1 l) dr) (- yf h)))
- (setq ept (list (+ x1 l) (- yf h kd (* 0.577 kd))))
- ))
- (command "line" topl topr botr botl "")
- (command "line" tof toe ept boe toe boe bof "")
- (command "layer" "s" "" "l" "hidden" "" "")
- (setq topr (list 0 0) dgr 0.001)
- (if (= sc 3)(setq dgr dr topr (list (+ x1 l) yb)))
- (command "circle" topr dgr)
- (if (or (= sc 4) (= sc 1))(setq lx (- xg xf) ly l))
- (if (or (= sc 5) (= sc 2))(setq lx (+ (- xg xf) l) ly (- yf yb)))
- (if (= sc 3)(setq lx l ly 0))
- (setq lx (/ lx s) ly (/ ly s) no (+ no 1) schl lx xchl ly)
- (if (= sc 1)(setq fpt (list xg (+ yb l))))
- (if (= sc 2)(setq fpt (list (+ x1 l) yf)))
- (if (= sc 3)(setq fpt topr))
- (if (= sc 4)(setq fpt toe))
- (if (= sc 5)(setq fpt boe))
- (attdef2)
- (attdef1 "ll1" ll fpt)
- (attdef1 "lk1" lk fpt)
- (attdef1 "gpsz1" "DK" fpt)
- (attdef1 "nk1" sc fpt)
- (attdef1 "dgch1" dgch fpt)
- (if (= sc 3)(setq botl (list (- (+ x1 l) dr) (- yb dr))))
- (if (= sc 3)(setq toe (list (+ x1 l dr) (+ yb dr))))
- (command "block" no fpt "w" botl toe "")
- (command "insert" no fpt "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "")
- (if (or (= sc 1) (= sc 4))(setq xg (+ xg h)))
- (if (or (= sc 2) (= sc 5))(setq yf (- yf h)))
- (redraw)
- (quit)