Тема: Построение инженерно-геологического разреза
(defun c:raz2 ()
(setq osmodmoya (getvar "OSMODE"))
(setvar "OSMODE" 0)
(setvar "dimzin" 2)
(initget 1)
(setq nnn (getint "масштаб разреза 1 100 2 200 5 500 10 1000 "))
(initget (+ 1 2 4))
(setq nnn1 (getint "\nколичество точек на лист "))
; (setq nnn1 (getstring "1 - скв. 2 - зонд 3 - скв. сз. "))
(initget 64)
(setq xp (getpoint "\nукажите точку положения разреза "))
(initget 1 "д н")
(setq s (getkword "\nрисуем шкалу? д/н"))
(initget 1 "д н")
(setq s1 (getkword "\nрисуем лист? д/н "))
(setq pnach xp )
;(setq pnach '(0 0 0))
(setvar "OSMODE" 15359)
(initget (+ 1 64))
(setq point(getpoint "\nукажите точку выработки "))
(setvar "OSMODE" 0)
(setq pointpoint (nth 2 point))
(setq point (subst 0 pointpoint point))
(setvar "OSMODE" 0)
(visota)
(initget 1)
(if (or (= h nil) (= h 0)) (setq h (getreal "\nвысота вырботки")))
(setq nshkala (fix (- h 18)))
(setq pnach1 (polar pnach (/ pi 2) (- (* 10 h) (* 10 nshkala ))))
(setq textotm (polar pnach (/ pi -2) 17)); текст отметки скважины
(setq textotm (polar textotm pi 5)); текст отметки скважины
(setq h2 (rtos h 2 2)); текст отметки скважины
(command "_text" textotm 2.5 0 h2); текст отметки скважины
(setq textotm (polar textotm (/ pi 2) 10))
(command "_text" textotm 2.5 0 "Скв.")
(command "_line" pnach pnach1 "")
(setq shopaotmetok (polar pnach (/ pi -2) 20))
(setq shopaotmetok1 (polar pnach (/ pi -2) 25))
(command "_line" shopaotmetok shopaotmetok1 "")
(setq pnachach (polar pnach pi 20))
(setq pnachach1 (polar pnach1 pi 20))
(setq pnachlin pnach1)
(if (= s "д") (raz3)(setq nshkala (+ nshkala 21)))
(repeat (- nnn1 1)
(setvar "OSMODE" 1)
(initget (+ 1 64))
(setvar "OSMODE" 15359)
(setq point1(getpoint "\nукажите точку выработки"))
(setvar "OSMODE" 0)
(setq pointpoint (nth 2 point1))
(setq point1 (subst 0 pointpoint point1))
(setvar "OSMODE" 0)
(initget 1)
(visota)
(initget 1)
(if (or (= h nil) (= h 0)) (setq h1 (getreal "\nвысота вырботки"))(setq h1 h))
(setq xp1 (distance point1 point))
(setq xp2 xp1)
(setq xp1 (* xp1 (/ 10 nnn) ))
(setq pnach (polar pnach 0 xp1))
(setq pnach1 (polar pnach (/ pi 2) (* 10 h1)))
(setq pnach1 (polar pnach (/ pi 2) (- (* 10 h1) (- (* 10 nshkala ) 210 ))))
(setq textotm (polar pnach (/ pi -2) 24)); текст расстоания
(setq textotm (polar textotm pi (+ (/ xp1 2) 5))); текст расстоания
(setq xp2 (rtos xp2 2 2)); текст расстоания
(command "_text" textotm 2.5 0 xp2); текст расстоания
(setq textotm (polar pnach (/ pi -2) 17)); текст отметки скважины
(setq textotm (polar textotm pi 5)); текст отметки скважины
(setq h2 (rtos h1 2 2)); текст отметки скважины
(command "_text" textotm 2.5 0 h2); текст отметки скважины
(setq textotm (polar textotm (/ pi 2) 10))
(command "_text" textotm 2.5 0 "Скв.")
(command "_line" pnachlin pnach1 "")
(command "_line" pnach pnach1 "")
(setq pnachlin pnach1)
(setq pnach3 pnach)
(setq pnach3 (polar pnach3 (/ pi -2) 20))
(setq pnach4 (polar pnach3 (/ pi -2) 5))
(command "_line" pnach3 pnach4 "")
(setq point point1)
); repeat
(if (= s1 "д") (listok) "")
(setvar "OSMODE" osmodmoya)
(setq h nil nnn nil nnn1 nil point nil point1 nil pnach nil pnach1 nil pnach3 nil pnach4 nil textotm nil xp2 nil)
)
; шкала
(defun raz3 ()
(setvar "OSMODE" 0)
;(command "_insert" "область построения" xp 1 1 0 0 "")
(setq pnach xp )
(setq pshkala (polar pnach pi 40))
(setq nshkala1 (rtos nshkala 2 2))
(repeat 21
(setq nshkala (+ 1 nshkala))
(setq pshkala (polar pshkala (/ pi 2) 10))
(setq nshkala1 (rtos nshkala 2 2))
(command "_text" pshkala 2.2 0 nshkala1 "")
)
; конец репиат
; шкала полилинеей
(setq xplin (polar xp pi 60.34))
(command "_line" xplin "@25<270" "@33.4473<0" "@235<90" "@2<180" "@210<270" "")
(setq xplin (polar xp pi 27.889))
(setq xplin1 (polar xplin (/ pi 2) 10))
(setq xplin2 (polar xp pi 59))
(setq xplin2 (polar xplin2 (/ pi -2) 4.5))
(command "_text" xplin2 2.5 0 "Вид и номер")
(setq xplin2 (polar xplin2 (/ pi -2) 4.5))
(command "_text" xplin2 2.5 0 "выработки")
(setq xplin2 (polar xplin2 (/ pi -2) 5))
(command "_text" xplin2 2.5 0 "Абс. отметка")
(setq xplin2 (polar xplin2 (/ pi -2) 4.5))
(command "_text" xplin2 2.5 0 "устья, м")
(setq xplin2 (polar xplin2 (/ pi -2) 5))
(command "_text" xplin2 2.5 0 "Расстояние, м")
(command "_pline" xplin xplin1 "ш" 2 2 "")
(repeat 10
(setq xplin (polar xplin (/ pi 2) 20))
(setq xplin1 (polar xplin (/ pi 2) 10))
(command "_pline" xplin xplin1 "ш" 2 2 "")
)
(setq xplin nil xplin1 nil)
; шкала полилинеей
(setvar "OSMODE" osmodmoya)
)
; шкала
;лист
(defun listok ()
(setvar "OSMODE" 0)
;;; лини горизонтальные с разреза
(setq xpgor (polar xp pi 60.3365))
(setq xpgor1 (polar pnach4 0 20))
(setq xpgor1 (polar xpgor1 (/ pi 2) 25))
(command "_line" xpgor xpgor1 "")
(setq xpgor (polar xpgor (/ pi -2) 10))
(setq xpgor1 (polar xpgor1 (/ pi -2) 10))
(command "_line" xpgor xpgor1 "")
(setq xpgor (polar xpgor (/ pi -2) 10))
(setq xpgor1 (polar xpgor1 (/ pi -2) 10))
(command "_line" xpgor xpgor1 "")
(setq xpgor (polar xpgor (/ pi -2) 5))
(setq xpgor1 (polar xpgor1 (/ pi -2) 5))
(command "_line" xpgor xpgor1 "")
(command "_line" pnachach pnachach1 "")
(setq pnachach (polar pnachach1 0 20))
(command "_line" pnachach pnachach1 "")
(setq pnach2 (polar pnach1 0 20))
(command "_line" pnach2 pnach1 "")
(setq pnach3p (polar pnach 0 20))
(command "_line" pnach3p pnach2 "")
;;; лини горизонтальные с разреза
(setq xplis (polar xp pi 110.0835))
(setq xplis (polar xplis (/ pi -2) 55.6253))
(setq xplis2 (polar xplis (/ pi 2) 297)); лево верх
(setq xplis3 xplis2)
(command "_line" xplis xplis2 "");левая линия
(setq xplis2 xplis)
(setq xplis (polar pnach3 (/ pi -2) 35.6253))
(setq xplis (polar xplis 0 225))
(command "_line" xplis xplis2 "")
(setq xplis (polar xplis (/ pi 2) 297))
;(command "_line" xplis2 xplis "")
(setq xplis2 (polar xplis (/ pi -2) 297))
(command "_line" xplis2 xplis "")
(command "_line" xplis xplis3 "")
(setq xplis3 (polar xplis3 0 20))
(setq xplis3 (polar xplis3 (/ pi -2) 5))
(setq xplis (polar xplis pi 5))
(setq xplis (polar xplis (/ pi -2) 5))
(command "_line" xplis3 xplis "")
(setq xplis2 (polar xplis3 (/ pi -2) 287))
(command "_line" xplis2 xplis3 "")
(setq xplis3 (polar xplis (/ pi -2) 287))
(command "_line" xplis xplis3 "")
(command "_line" xplis2 xplis3 "")
;(command "_insert" "штамп на разрез2" xplis3 1 1 0 0)
(setq xplis3 (polar xplis3 pi 92))
(setq xplis3 (polar xplis3 (/ pi 2) 6.0544))
(command "_text" xplis3 2.5 0 (* nnn 100))
(setvar "OSMODE" osmodmoya)
)
; лист
(defun visota ()
(prompt "\nнажмите на текст содержащий высоту выработки:")
(setq ss nil)
(setq e1 nil)
(setq h nil)
(setq ss (ssget "_:S" '((-4 . "<OR")(0 . "DIMENSION") (0 . "TEXT")(0 . "MTEXT")(-4 . "OR>"))))
(if ss
(progn
(initget 2)
(setq sslen nil)
(setq e nil)
(setq k nil)
(setq e (entget (ssname ss 0)))
(setq h (cdr (assoc 1 e)))
(setq h (atof h))
""); конец иф
)
)