home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p190 / 3.ddi / LSP / HM23.LSP < prev    next >
Encoding:
Text File  |  1990-03-12  |  5.0 KB  |  142 lines

  1. (DEFUN CENLINE1 ()
  2. (MENUCMD "S=IN2")
  3. (INITGET "Y N")
  4. (SETQ YN (GETKWORD "\n╩╟╦«╞╜╖╜╧≥╡─┐╫┬≡? (Y) "))
  5. (IF (= YN "N") (SETQ BAT 2) (SETQ BAT 1))
  6. (COMMAND "OSNAP" "NEAREST")
  7. (setq str1 (getpoint "\n╙├ ╩« ╫╓ ╧▀ ╢¿ ╗∙ ├µ ╬╗ ╓├: "))
  8. ;(setq str1 (osnap str "nea"))
  9. (setq x1 (car str1) y1 (cadr str1) sc 0)
  10. ;(if (= (fix y1) (fix yb))(setq bat 1)(setq bat 2))
  11. (MENUCMD "S=IN1")
  12. (setq l (getreal "\n╡╜ ╗∙ ├µ ╛α └δ=: "))
  13. (setq FPT (getpoint "\n╙├ ╩« ╫╓ ╧▀ ╢¿ ╞≡ ╩╝ ├µ:"))
  14. ;(setq fpt (osnap str "nea"))
  15. (setq xg (car fpt) yf (cadr fpt) l1 l l (* l s))
  16. (setq ept (getpoint "\n╙├ ╩« ╫╓ ╧▀ ╢¿ ╓╒ ╓╣ ├µ: "))
  17. (COMMAND "OSNAP" "NONE")
  18. (setq xe (car ept) ye (cadr ept) ll 1 lk 0)
  19. (if (= bat 2)(progn
  20. (if (> yf ye)(setq sc bat))
  21. (if (< yf ye)(setq sc (+ bat 3)))
  22. ))
  23. (if (= bat 1)(progn
  24. (if (> xe xg)(setq sc bat))
  25. (if (< xe xg)(setq sc (+ bat 3)))
  26. ))
  27. (if (or (= sc 1) (= sc 2))(setq tg 0.1)(setq tg (- 0 0.1)))
  28. (if (or (= sc 1) (= sc 4))(setq tof (list (- xg tg) (+ yb l)) toe (list (+ xe tg) (+ yb l))))
  29. (if (or (= sc 2) (= sc 5))(setq tof (list (+ x1 l) (+ yf tg)) toe (list (+ x1 l) (- ye tg))))
  30. (if (and (= yf ye) (= xg xe))(setq sc 3))
  31. (if (/= l 0)(setq ll (getreal "\n┐╫ ╡─ ╕÷ ╩²=: ")))
  32. ;(if (and (/= l 0) (/= sc 2))(setq lk (getreal "\n┐╫ ╙δ ╓╨ ╨─ ╝╨ ╜╟=: ")))
  33. (COND ((and (/= l 0) (/= sc 2))
  34.   (setq lk (getreal "\n┐╫╙δ╓╨╨─╝╨╜╟(0): "))
  35.   (COND ((= LK NIL)(SETQ LK 0)))
  36. ))
  37. )
  38. ;**************************************
  39. ;*  The program for drawing centerline.*
  40. ;***************************************
  41. (DEFUN CENLINE ()
  42. ;(SETVAR "CMDECHO" 0)
  43. (command "layer" "n" "f6" "s" "f6" "l" "dashdot" "" "color" "1" "" "")
  44. (cenline1)
  45. (command "line" tof toe "")
  46. (command "layer" "n" "f8" "s" "f8" "l" "hidden" "" "color" "4" "" "")
  47. ;(redraw)
  48. ;(MENUCMD "I=DD")
  49. ;(MENUCMD "I=*")
  50. )
  51. ;*****************************************
  52. ;*  The program for drawing screw hole.  *
  53. ;*****************************************
  54. (DEFUN DK ()
  55. (SETVAR "CMDECHO" 0)
  56. (SETVAR "BLIPMODE" 0)
  57. (CENLINE)
  58. (MENUCMD "S=IN1")
  59. (setq dr (getreal "\n╩Σ ╚δ ╓▒ ╛╢=: "))
  60. (setq dgch "  ")
  61. (MENUCMD "S=IN2")
  62. (setq yn (getstring "\n╙╨ ┼Σ ║╧ ╛½ ╢╚ ╖±(N)? "))
  63. (if (or (= yn "y") (= yn "Y"))
  64.  (PROGN
  65.  (MENUCMD "S=CY1")
  66.  (setq dgch (getstring "\n╩Σ ╚δ ┼Σ ║╧ ╛½ ╢╚: "))
  67. ))
  68. (MENUCMD "S=IN1")
  69. (setq h (getreal "\n╩Σ ╚δ ╢ñ ┐╫ ╔ε ╢╚=: "))
  70. (setq dgl 0. dgr 0.)
  71. (setq dr1 dr dl1 dr l1 h dgl1 dgl dgr1 dgr)
  72. (setq dr (* (/ dr 2) s) h (* h s))
  73. (setq m1 0 dl dr)
  74. (if (or (= sc 1) (= sc 4))(setq m1 1))
  75. (if (or (= sc 2) (= sc 5))(setq m1 2))
  76. (if (or (= sc 1) (= sc 2))(setq kd dl))
  77. (if (or (= sc 4) (= sc 5))(setq kd (- 0 dl)))
  78. (setq topl (list 0 0) botl (list 0 0) tof (list 0 0) bof (list 0 0))
  79. (setq botr (list 0 0) toe (list 0 0) boe (list 0 0))
  80. (if (or (= sc 4) (= sc 5))(setq h (- 0 h) dgl (- 0 dgl) dgr (- 0 dgr)))
  81. (if (= m1 1)(progn
  82.             (setq topl (list xg (+ yb l dl)))
  83.             (setq botl (list xg (- (+ yb l) dl)))
  84.             (setq tof (list xg (- (+ yb l dl) s)))
  85.             (setq bof (list xg (- (+ yb l s) dl)))
  86.             (setq toe (list (+ xg h kd) (- (+ yb l dl) s)))
  87.             (setq boe (list (+ xg h kd) (- (+ yb l s) dl)))
  88.             (setq topr (list (+ xg h) (+ yb l dr)))
  89.             (setq botr (list (+ xg h) (- (+ yb l) dr)))
  90.             (setq ept (list (+ xg h kd (* 0.577 kd)) (+ yb l)))
  91. ))
  92. (if (= m1 2)(progn
  93.             (setq topl (list (+ x1 l dl) yf))
  94.             (setq botl (list (- (+ x1 l) dl) yf))
  95.             (setq tof (list (- (+ x1 l dl) s) yf))
  96.             (setq bof (list (- (+ x1 l s) dl) yf))
  97.             (setq toe (list (- (+ x1 l dl) s) (- yf h kd)))
  98.             (setq boe (list (- (+ x1 l s) dl) (- yf h kd)))
  99.             (setq topr (list (+ x1 l dr) (- yf h)))
  100.             (setq botr (list (- (+ x1 l) dr) (- yf h)))
  101.             (setq ept (list (+ x1 l) (- yf h kd (* 0.577 kd))))
  102. ))
  103. (command "line" topl topr botr botl "")
  104. (command "line" tof toe ept boe toe boe bof "")
  105. (command "layer" "s" "" "l" "hidden" "" "")
  106. (setq topr (list 0 0) dgr 0.001)
  107. (if (= sc 3)(setq dgr dr topr (list (+ x1 l) yb)))
  108. (command "circle" topr dgr)
  109. (if (or (= sc 4) (= sc 1))(setq lx (- xg xf) ly l))
  110. (if (or (= sc 5) (= sc 2))(setq lx (+ (- x1 xf) l) ly (- yf yb)))
  111. (if (= sc 3)(setq lx l ly 0))
  112. (setq lx (/ lx s) ly (/ ly s) no (+ no 1) schl lx xchl ly)
  113. (if (= sc 1)(setq fpt (list xg (+ yb l))))
  114. (if (= sc 2)(setq fpt boe))
  115. (if (= sc 3)(setq fpt topr))
  116. (if (= sc 4)(setq fpt boe))
  117. (if (= sc 5)(setq fpt botl))
  118. (attdef2)
  119. (attdef1 "ll1" ll fpt)
  120. (attdef1 "lk1" lk fpt)
  121. (attdef1 "gpsz1" "DK" fpt)
  122. (attdef1 "nk1" sc fpt)
  123. (attdef1 "dgch1" dgch fpt)
  124. (if (= sc 3)(setq botl (list (- (+ x1 l) dr) (- yb dr))))
  125. (if (= sc 3)(setq toe (list (+ x1 l dr) (+ yb dr))))
  126. (command "block" no fpt "w" botl toe "")
  127. (command "insert" no fpt "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "")
  128. (if (or (= sc 1) (= sc 4))(setq xg (+ xg h)))
  129. (if (or (= sc 2) (= sc 5))(setq yf (- yf h)))
  130. ;(redraw)
  131. (MENUCMD "S=SCREEN")
  132. (MENUCMD "S=IN2")
  133. (SETQ YN (GETSTRING "\n╩╟╖±╝╠╨°╗¡┐╫: "))
  134. (IF (OR (= YN "Y") (= YN "y"))
  135.  (PROGN(MENUCMD "I=DD")
  136.        (MENUCMD "I=*")
  137.  )
  138.  (MENUCMD "S=SCREEN")
  139. )
  140. )
  141. (DK)
  142.