home *** CD-ROM | disk | FTP | other *** search
- (defun input (sl m)
- ;(SETVAR "CMDECHO" 0)
- (MENUCMD "S=IN1")
- (initget (+ 1 2 4))
- (setq l (getreal "\n╩Σ ╚δ │ñ ╢╚=: "))
- (if (= sl 1)(setq l (rtos l)))
- (if (= l "t")(setq l "T"))
- (if (and (= sl 1) (/= l "T"))(setq l (atof l)))
- (if (= l "T")(setq l (- m xb) l (/ l s)))
- (if (= l "t")(setq l (- m xb) l (/ l s)))
- (setq schl 0 xchl 0)
- (MENUCMD "S=IN2")
- (setq yn (getstring "\n╙╨ ╣½ ▓ε ╖±(N)? "))
- (MENUCMD "S=IN1")
- (if (= yn "")(setq yn "n" schl 0 xchl 0))
- (if (or (= yn "y") (= yn "Y"))(progn
- (setq schl (getreal "\n╔╧ ╞½ ▓ε=: "))
- (setq xchl (getreal "\n╧┬ ╞½ ▓ε=: "))
- )
- )
- (setq angl 0 angr 0)
- (setq dgl (getreal "\n╫≤ ╡╣ ╜╟ │ñ ╢╚=:(0) "))
- (if (null dgl)(setq dgl 0))
- (if (> dgl 0)(setq angl (getreal "\n╫≤ ╡╣ ╜╟=: ")))
- (if (= dgl 0)(progn
- (setq dgl (getreal "\n╫≤ ╡╣ ╘▓ ┴┐=:(0) "))
- (if (null dgl)(setq dgl 0))
- (if (/= dgl 0)(setq dgl (- 0 dgl)))
- ))
- (setq dgr (getreal "\n╙╥ ╡╣ ╜╟ │ñ ╢╚=:(0) "))
- (if (null dgr)(setq dgr 0))
- (if (> dgr 0)(setq angr (getreal "\n╙╥ ╡╣ ╜╟=: ")))
- (if (= dgr 0)(progn
- (setq dgr (getreal "\n╙╥ ╡╣ ╘▓ ┴┐=:(0) "))
- (if (null dgr)(setq dgr 0))
- (if (/= dgr 0)(setq dgr (- 0 dgr)))
- ))
- (setq yn "")
- (MENUCMD "S=SCREEN")
- )
- ;**************************************
- ;* The fuction for drwing thread. *
- ;*************************************
- (defun screw (sl m)
- ;(SETVAR "CMDECHO" 0)
- (setq dgch " ")
- (setq da 0 )
- (MENUCMD "S=TH1")
- (initget 1 "m M t T p P")
- (setq sc (getkword "\n╤í ╘± ┬▌ ╬╞ └α ╨═(M ; T ; P): "))
- (if (null sc )(setq sc "M"))
- (if (= sc "m")(setq sc "M"))
- (if (= sc "t")(setq sc "T"))
- (if (or (= sc "p")(= sc "P"))(setq sc "PI"))
- (if (= sc "M")(PROGN
- (MENUCMD "S=TH2")
- (initget (+ 1 2 4))
- (setq m1 (getreal "\n╩Σ ╚δ ╓▒ ╛╢=: "))
- ))
- (if (= sc "T")
- (PROGN
- (MENUCMD "S=TH3")
- (initget (+ 1 2 4))
- (setq m1 (getreal "\n╩Σ ╚δ ╓▒ ╛╢=: "))
- ; (SETQ TT (GETREAL "\n╩Σ╚δ┬▌╛α: "))
- ))
- (if (= sc "PI")(progn
- (MENUCMD "S=TH4")
- (initget (+ 1 2 4))
- (setq dgch (getstring "\n╩Σ ╚δ ╓▒ ╛╢=: "))
- (if (= (strlen dgch) 4)(setq mm (substr dgch 1 1) mm1 (substr dgch 2)))
- (if (= (strlen dgch) 4)(setq dgch (strcat mm " " mm1)))
- (setq mm (substr dgch 1 1) mm1 (substr dgch 5))
- (if (and (< (atof mm1) 1) (< (atof mm) 1))(setq m1 25))
- (if (and (< (atof mm1) 1) (= (atof mm) 1))(setq m1 33))
- (if (and (> (atof mm1) 1) (= (atof mm) 1))(setq m1 42))
- (if (and (< (atof mm1) 1) (= (atof mm) 2))(setq m1 60))
- (if (and (> (atof mm1) 1) (= (atof mm) 2))(setq m1 75))
- (if (and (< (atof mm1) 1) (= (atof mm) 3))(setq m1 87))
- (if (and (> (atof mm1) 1) (= (atof mm) 3))(setq m1 100))
- (if (and (< (atof mm1) 1) (= (atof mm) 4))(setq m1 113))
- (if (and (< (atof mm1) 1) (= (atof mm) 5))(setq m1 138))
- ))
- (input sl m)
- (setq dr1 m1 dl1 m1)
- (setq l1 l dgl1 dgl dgr1 dgr)
- (if (< dgl 0)(setq dgl 0))
- (if (< dgr 0)(setq dgr 0))
- (setq l (* l s) dgl (* dgl s) dgr (* dgr s))
- (setq dr (/ (* m1 s) 2) dl dr)
- (setq kd (/ (* (- m1 4) s) 2))
- (dbsa1 xb sl)
- (setq tof (list (+ xb dgl) (+ yb kd)))
- (setq toe (list (- (+ xb l) dgr) (+ yb kd)))
- (setq bof (list (+ xb dgl) (- yb kd)))
- (setq boe (list (- (+ xb l) dgr) (- yb kd)))
- (command "line" tof toe "")
- (command "line" bof boe "")
- (setq fpt (list xb yb))
- (attdef2)
- (attdef1 "gpsz1" sc fpt)
- (attdef1 "dgch1" dgch fpt)
- )
- ;******************************************
- ;* The function for drawing thread. *
- ;******************************************
- (DEFUN THREAD ()
- (SETVAR "CMDECHO" 0)
- (SETVAR "BLIPMODE" 0)
- (screw 0 0)
- (FN)
- (if (= nol no)
- (command "block" no "Y" fpt "w" (list xb (- yb dr)) (list (+ xb l) (+ yb dr)) "")
- (command "block" no fpt "w" (list xb (- yb dr)) (list (+ xb l) (+ yb dr)) "")
- )
- (command "insert" no fpt "" "" "" "" "" "" "" "" "" "" "" "" "" "")
- (XB1)
- (redraw)
- (MENUCMD "S=IN2")
- (SETQ YN (GETSTRING "\n╩╟╖±╝╠╨°╗¡═Γ▒φ├µ: "))
- (IF (OR (= YN "Y") (= YN "y") (= YN ""))
- (PROGN(MENUCMD "I=YY")
- (MENUCMD "I=*")
- )
- (MENUCMD "S=SCREEN")
- )
- )
- (THREAD)