Код mst.lsp
(defun DX (Point XXX) (polar Point 0 XXX))
(defun DY (Point YYY) (polar Point (/ 3.1415926 2.0) YYY))
(defun DXY (Point XXX YYY) (setq PPPP (polar Point 0 XXX))
(polar PPPP (/ 3.1415926 2.0) YYY))
(defun Morf ()
(setq M_gor 2.0 M_ver 0.1 RUVV_PROC "1")
(setq M_VER_D (rtos (* M_ver 1000) 2 0))
(setq M_GOR_D (rtos (* M_gor 1000) 2 0))
(if (< (setq dcl_id (load_dialog "dial_mst.dcl")) 0) (exit))
(if (not (new_dialog "MST" dcl_id)) (exit))
(setq dialog_ok nil)
(SET_TILE "M_VER_D" M_VER_D) (SET_TILE "M_GOR_D" M_GOR_D)
(SET_TILE "RUVV_PROC" RUVV_PROC)
(action_tile "M_VER_D" "(setq M_VER_D $value)")
(action_tile "M_GOR_D" "(setq M_GOR_D $value)")
(action_tile "RUVV_PROC" "(setq RUVV_PROC $value)")
(action_tile "accept" "(setq dialog_ok T)(done_dialog)")
(action_tile "cancel" "(done_dialog 0)")
(start_dialog)
(if dialog_ok (progn
(setq M_VER (/ (atof M_VER_D) 1000.0) M_GOR (/ (atof M_GOR_D) 1000.0))
(sta_vv)));end progn if
);end defun morf
(defun sta_vv ()
(setq cur_dir "c:/" dialog_ok nil)
(if (< (setq dcl_id (load_dialog "dial_mst.dcl")) 0) (exit))
(if (not (new_dialog "menu_stam" dcl_id)) (exit))
(setq fd (open (strcat cur_dir "stamv.dat") "r"))
(if (= fd nil) (progn
(setq name_or1 "Хабаровский филиал" name_or2 "ОАО Гипродорнии")
(setq name_1 "Автомобильная доpога Владивосток-Hаходка на")
(setq name_2 "на участке км207 - км220 в Пpимоpском кpае")
(setq name_ch "Моpфоствоp N9" nkomp "Мост чеpез pеку Волчанка")
(setq isp "Сыpчин" nach "Жандаpов" shifr "2888" dat_pl "12.99")
);end progn
(progn
(setq name_1 (read-line fd) name_2 (read-line fd))
(setq name_ch (read-line fd) nkomp (read-line fd))
(setq isp (read-line fd) nach (read-line fd))
(setq shifr (read-line fd) dat_pl (read-line fd))
(setq name_or1 (read-line fd) name_or2 (read-line fd))
(if (= name_or1 nil) (setq name_or1 ""));end if
(if (= name_or2 nil) (setq name_or2 ""));end if
(close fd)));end progn if
(SET_TILE "name_or1" name_or1) (SET_TILE "name_or2" name_or2)
(SET_TILE "name_1" name_1) (SET_TILE "name_2" name_2)
(SET_TILE "name_ch" name_ch) (SET_TILE "nkomp" nkomp)
(SET_TILE "isp" isp) (SET_TILE "nach" nach)
(SET_TILE "shifr" shifr) (SET_TILE "dat_pl" dat_pl)
(action_tile "name_or1" "(setq name_or1 $value)")
(action_tile "name_or2" "(setq name_or2 $value)")
(action_tile "name_1" "(setq name_1 $value)")
(action_tile "name_2" "(setq name_2 $value)")
(action_tile "name_ch" "(setq name_ch $value)")
(action_tile "nkomp" "(setq nkomp $value)")
(action_tile "isp" "(setq isp $value)")
(action_tile "nach" "(setq nach $value)")
(action_tile "shifr" "(setq shifr $value)")
(action_tile "dat_pl" "(setq dat_pl $value)")
(action_tile "accept" "(setq dialog_ok T)(done_dialog 0)")
(action_tile "cancel" "(done_dialog 0)")
(start_dialog)
(if (= dialog_ok T) (progn
(setq fd (open (strcat cur_dir "stamv.dat") "w"))
(write-line name_1 fd) (write-line name_2 fd) (write-line name_ch fd)
(write-line nkomp fd) (write-line isp fd) (write-line nach fd)
(write-line shifr fd) (write-line dat_pl fd) (write-line name_or1 fd)
(write-line name_or2 fd) (close fd) (mst)));end progn if
);end defun sta_vv
(defun MST ()
(setvar "cmdecho" 0) (setvar "dimzin" 0) (setvar "osmode" 0)
;создание требуемых слоев с проверкой
(if (not (tblsearch "layer" "0"))
(command "_layer" "_make" "0" "_color" "7" "" ""));end if
(if (not (tblsearch "layer" "blue"))
(command "_layer" "_make" "blue" "_color" "5" "" ""));end if
(if (not (tblsearch "layer" "brown"))
(command "_layer" "_make" "brown" "_color" "24" "" ""));end if
(command "_layer" "_set" "0" "")
;считывание исходных данных
;профиль морфоствора
(setq fd (open (strcat cur_dir "stvor.dat") "r"))
(setq spis_stv (list " ") H_min 10000 H_max -10000 n_thk 1)
(while (setq line (read-line fd))
(setq spis_stv (cons line spis_stv)) (init_stv)
(if (= n_thk 1) (setq Nach_Pk Pk_i_thk Nach_Pl Pl_i_thk));end if
(setq End_Pk Pk_i_thk End_Pl Pl_i_thk)
(if (< H_i_thk H_min) (setq H_min H_i_thk));end if
(if (> H_i_thk H_max) (setq H_max H_i_thk));end if
(setq n_thk (+ n_thk 1)));end while
(setq spis_stv (cdr (reverse spis_stv))) (close fd)
(setq n_thk (length spis_stv))
;характеристики участков
(setq fd (open (strcat cur_dir "uchast.dat") "r") spis_uch (list " "))
(while (setq line (read-line fd))
(setq spis_uch (cons line spis_uch)));end while
(setq spis_uch (cdr (reverse spis_uch))) (close fd)
(setq N_uch (length spis_uch))
;результаты расчета
(setq fd (open (strcat cur_dir "rez.dat") "r") spis_rez (list " "))
(repeat N_uch (setq line (read-line fd))
(setq spis_rez (cons line spis_rez)));end repeat
(setq spis_rez (cdr (reverse spis_rez)))
(setq RUVV (atof (read-line fd)) Q_rasch (atof (read-line fd)))
(close fd)
(setq L_dwg (- (* End_Pk 100.0) (* Nach_pk 100.0)))
(setq H_dwg (- H_max H_min) L_nul 60 H_nul 100)
(setq TXT_nul (list 61 18))
(setq Nach_Uch (+ (* 100.0 Nach_Pk) Nach_Pl))
(setq nachalo Nach_Uch TXT_Uch (list 60 0))
(setq GR_1 (list 60 100) N_i_tbl 1 TRIG_UR 0)
(setq P_nul (list L_nul H_nul))
(setq HHH (fix (- H_min 2.0))) ;Эту вел-ну надо отнимать от отметок
(if (< H_min 2.0)(setq HHH 0))
(setq H_rasch (+ 100.0 (/ (- RUVV HHH) M_ver))); Hpасч от Y=0 в мм-pах
(SETKA L_dwg H_dwg)
(setq line (nth 0 spis_stv)) (init_stv)
(setq P_prev (DY P_nul (/ (- H_i_thk HHH) M_ver)))
(setq P_pre1 P_prev X_prev L_nul)
(command "_line" P_prev (list L_nul 45) "")
(command "_line" (dy P_nul -85) (dy P_nul -90) "")
(command "_text" TXT_nul "1.8" "90" (Rtos H_i_thk 2 2))
(setq N_THK_UR 0 Triger 1)
(setq nom_uch 0 nom_poi 1)
(repeat N_uch
(setq line (nth nom_uch spis_uch)) (init_uch)
(setq NN_thk (fix (- N_end N_nach)))
(repeat NN_thk
(setq line (nth nom_poi spis_stv)) (init_stv)
(setq N_i_thk (+ nom_poi 1)) ;Hомеp i-й точки
(setq P_next (DXY P_NUL (/ (- (+ (* Pk_i_thk 100.0) PL_i_thk) nachalo) M_gor) (/ (- H_i_thk HHH) M_ver)))
(setq L_i_uch (- (car P_next) (car P_prev)))
(setq L_i_zona (rtos (* M_gor (- (car P_next) (car P_prev))) 2 0))
(setq End_Uch (+ (* 100.0 Pk_i_thk) Pl_i_thk))
(command "_layer" "_set" "brown" "")
(command "_line" P_prev P_next "")
(command "_layer" "_set" "0" "")
(setq P_i (DX P_NUL (/ (- (+ (* Pk_i_thk 100.0) PL_i_thk) nachalo) M_gor)))
(setq P_L_txt (DXY P_i (/ L_i_uch -2) -87.5))
(command "_line" P_next P_i "")
(setq P_shtr_1 (DY P_i -85) P_shtr_2 (DY P_shtr_1 -5))
(command "_line" P_shtr_1 P_shtr_2 "")
(GORISONT) (setq P_prev P_next)
(setq TXT_i (DX TXT_nul (/ (- (+ (* Pk_i_thk 100.0) PL_i_thk) nachalo) M_gor)))
(setq L_i_uc1 (- (car P_next) (car P_pre1)))
(if (< L_i_uc1 4) (setq Triger -1) (setq Triger 1))
(if (> L_i_uch 4) (command "_text" "_m" P_L_txt "2.5" "0" L_i_zona))
(if (= Triger 1) (progn
(command "_style" "" "" "0" "0.9" "0" "_n" "_n" "_n")
(command "_text" TXT_i "1.7" "90" (Rtos H_i_thk 2 2))
(setq P_pre1 P_next)));end progn if
(if (= Triger -1) (H_TABL));end if
(setq nom_poi (+ nom_poi 1)));end repeat NN_tck
(setq L_uch (/ (- End_Uch Nach_Uch) M_gor))
(setq Nach_Uch End_uch)
(setq GR_1 (DX GR_1 L_uch) GR_2 (DY GR_1 -55))
(command "_line" GR_1 GR_2 "")
(setq P_txt (DX TXT_Uch (/ L_Uch 2)))
(setq TXT_Uch (DX TXT_Uch L_Uch))
(setq K_txt 0.8)
(if (< L_uch 11.0) (setq K_txt 0.65))
(if (< L_uch 7.0) (setq K_txt 0.55))
(command "_style" "" "" "0" K_TXT "0" "_n" "_n" "_n")
(setq line (nth nom_uch spis_rez)) (init_rez)
(command "_text" "_m" (DY P_txt 92.4) "2.5" "0" (rtos N_i_uch 2 0))
(command "_text" "_m" (DY P_txt 87.4) "2.5" "0" (rtos B_i_uch 2 2))
(command "_text" "_m" (DY P_txt 82.4) "2.5" "0" (rtos Gi_i_uch 2 2))
(command "_text" "_m" (DY P_txt 77.4) "2.5" "0" (rtos S_i_uch 2 2))
(command "_text" "_m" (DY P_txt 72.4) "2.5" "0" (rtos Uklon 2 2))
(command "_text" "_m" (DY P_txt 67.4) "2.5" "0" (rtos K_cher 2 2))
(command "_text" "_m" (DY P_txt 62.4) "2.5" "0" (rtos Kosina 2 2))
(command "_text" "_m" (DY P_txt 57.4) "2.5" "0" (rtos V_i_uch 2 2))
(command "_text" "_m" (DY P_txt 52.4) "2.5" "0" (rtos Q_i_uch 2 2))
(setq nom_uch (+ nom_uch 1)));end repeat N_uch
(setq P1 P_tbl P2 (list 0 (cadr P1)))
(setq P3 (list 0 0) P4 (list (car P1) 0) t0t P4) (command "_color" 7)
(command "_pline" P1 "_W" "0.5" "0.5" P2 P3 P4 P1 "")
(command "_zoom" "_all")
(command "_pline" t0t "_w" "0.5" "" (dxy t0t -55 0) (dxy t0t -55 185)
(dxy t0t 0 185) "_c")
(command "_pline" (dxy t0t -30 10) (dxy t0t -55 10) "")
(command "_pline" (dxy t0t 0 20) (dxy t0t -55 20) "")
(command "_pline" (dxy t0t -30 30) (dxy t0t -55 30) "")
(command "_pline" (dxy t0t 0 40) (dxy t0t -55 40) "")
(command "_pline" (dxy t0t 0 55) (dxy t0t -55 55) "")
(command "_pline" (dxy t0t 0 65) (dxy t0t -55 65) "")
(command "_pline" (dxy t0t -30 0) (dxy t0t -30 185) "")
(command "_pline" (dxy t0t -35 0) (dxy t0t -35 65) "")
(command "_pline" (dxy t0t -15 65) (dxy t0t -15 185) "")
(command "_pline" (dxy t0t -45 65) (dxy t0t -45 185) "")
(command "_pline" (dxy t0t -25 135) (dxy t0t -25 185) "")
(command "_pline" (dxy t0t 0 135) (dxy t0t -30 135) "")
(command "_pline" (dxy t0t -15 150) (dxy t0t -30 150) "")
(command "_pline" (dxy t0t -15 165) (dxy t0t -30 165) "")
(setq t1 (dxy t0t -5 0))
(repeat 10 (command "_line" t1 (dxy t1 0 65) "")
(setq t1 (dxy t1 -5 0)));end repeat
(command "_text" "_fit" (dxy t0t -31 1) (dxy t0t -31 9) "2.5" "Изм.")
(command "_text" "_fit" (dxy t0t -31 10.5) (dxy t0t -31 19.5) "2.5" "Кол.уч.")
(command "_text" "_fit" (dxy t0t -31 21) (dxy t0t -31 29) "2.5" "Лист")
(command "_text" "_fit" (dxy t0t -31 30.5) (dxy t0t -31 39.5) "2.5" "N док.")
(command "_text" "_fit" (dxy t0t -31 41) (dxy t0t -31 54) "2.5" "Подпись")
(command "_text" "_fit" (dxy t0t -31 56) (dxy t0t -31 64) "2.5" "Дата")
(setq spis_isp (list "Разраб." isp "Провер." nach))
(setq col_isp (/ (length spis_isp) 2) n_isp 0 t1 (dxy t0t -25 0))
(repeat col_isp (setq ispol (nth n_isp spis_isp))
(if (< (strlen ispol) 8) (command "_text" (dxy t1 -1 1) "2.5" "90" ispol)
(command "_text" "_fit" (dxy t1 -1 1) (dxy t1 -1 19) "2.5" ispol));end if
(setq n_isp (+ n_isp 1) famil (nth n_isp spis_isp))
(if (< (strlen famil) 8) (command "_text" (dxy t1 -1 21) "2.5" "90" famil)
(command "_text" "_fit" (dxy t1 -1 21) (dxy t1 -1 39) "2.5" famil));end if
(command "_text" "_fit" (dxy t1 -1 56) (dxy t1 -1 64) "2.5" dat_pl)
(setq t1 (dxy t1 5 0) n_isp (+ n_isp 1)));end repeat
;заполнение наименование объекта
(setq spis_name (list name_1 name_2) n_name 0 t1 (dxy t0t -39 125))
(repeat 2 (setq name (nth n_name spis_name))
(if (< (strlen name) 48) (command "_text" "_c" t1 "2.5" "90" name)
(command "_text" "_fit" (dxy t1 0 -59) (dxy t1 0 59) "2.5" name));end if
(setq t1 (dxy t1 5.5 0) n_name (+ n_name 1))
);end repeat
;заполнение гpафы наименование комплекта
(if (< (strlen nkomp) 28) (command "_text" "_c" (dxy t0t -21 100) "2.5" "90" nkomp)
(command "_text" "_fit" (dxy t0t -21 66) (dxy t0t -21 134) "2.5" nkomp));end if
(command "_text" "_fit" (dxy t0t -26 136) (dxy t0t -26 149) "2.5" "Стадия")
(command "_text" "_c" (dxy t0t -26 157.5) "2.5" "90" "Лист")
(command "_text" "_c" (dxy t0t -26 175) "2.5" "90" "Листов")
(command "_text" "_c" (dxy t0t -18 142.5) "3.5" "90" "P")
(command "_text" "_c" (dxy t0t -18 157.5) "3.5" "90" "1")
(command "_text" "_c" (dxy t0t -18 175) "3.5" "90" "1")
(command "_text" "_c" (dxy t0t -48 135) "3.5" "90" shifr)
;заполнение гpафы наименование чеpтежа
(if (< (strlen name_ch) 28) (command "_text" "_c" (dxy t0t -6 100) "2.5" "90" name_ch)
(command "_text" "_fit" (dxy t0t -6 66) (dxy t0t -6 134) "2.5" name_ch));end if
;заполнение гpафы наименование организации
(setq spis_name (list name_or1 name_or2) n_name 0 t4 (dxy t0t -8.5 160))
(repeat 2 (setq name (nth n_name spis_name))
(if (< (strlen name) 20) (command "_text" "_c" t4 "2.5" "90" name)
(command "_text" "_fit" (dxy t4 0 -24) (dxy t4 0 24) "2.5" name));end if
(setq t4 (dxy t4 5.5 0) n_name (+ n_name 1))
);end repeat
);end defun mst
(defun SETKA (L_dwg H_dwg)
(command "_style" "" "" "0" "0.9" "0" "_n" "_n" "_n")
(command "_zoom" "_w" "5,5" "150,150")
(if (> H_dwg 15) (setq M_ver 0.2))
(setq P1 (list 0 0))
(if (< L_dwg 100.0) (setq L_dwg (fix (/ (+ L_dwg 100.0) M_gor)))
(setq L_dwg (fix (/ (+ L_dwg end_pl) M_gor))));end if
(setq H_dwg (fix (/ H_dwg M_ver)))
(setq P2 (DX P1 (+ 160 L_dwg)))
(setq P3 (DXY P1 (+ 160 L_dwg) 287))
(setq P_tbl P3 P4 (DY P1 287))
(setq P3 (DXY P1 5 5) P4 (DXY P2 -90 5))
(command "_line" P3 P4 "")
(command "_array" "_C" (dxy P4 -2 -2) (dxy P4 -2 2) "" "_Rectang" "3" "1" "5")
(command "_array" "_C" (dxy P4 -2 8) (dxy P4 -2 12) "" "_Rectang" "3" "1" "15")
(command "_array" "_C" (dxy P4 -2 38) (dxy P4 -2 42) "" "_Rectang" "12" "1" "5")
(command "_line" "5,5" "5,100" "") (command "_line" "55,5" "55,100" "")
(command "_text" "_m" "30,97.4" "2.5" "0" "Характ.грунтов")
(command "_text" "_m" "30,92.4" "2.5" "0" "NN участков")
(command "_text" "_m" "30,87.4" "2.5" "0" "Ширина уч-ка В,м")
(command "_text" "_m" "30,82.4" "2.5" "0" "Сред. глубина Н,м")
(command "_text" "_m" "30,77.4" "2.5" "0" "Площадь сечения W,м")
(command "_text" "_m" "30,72.4" "2.5" "0" "Уклон i,м")
(command "_text" "_m" "30,67.4" "2.5" "0" "Коэффиц.шерохов. n")
(command "_text" "_m" "30,62.4" "2.5" "0" "Косина потока cos a")
(command "_text" "_m" "30,57.4" "2.5" "0" "Сред.скорость V,м/с")
(command "_text" "_m" "30,52.4" "2.5" "0" "Расход Q,м3/с")
(command "_text" "_m" "30,47.4" "2.5" "0" "% от суммарного Q")
(command "_text" "_m" "30,42.4" "2.5" "0" "Ситуация и харак-")
(command "_text" "_m" "30,37.4" "2.5" "0" "теристика расти-")
(command "_text" "_m" "30,33.2" "2.5" "0" "тельности")
(command "_text" "_m" "30,22.4" "2.5" "0" "Отметки земли,м")
(command "_text" "_m" "30,12.4" "2.5" "0" "Расстояния,м")
(command "_text" "_m" "30,7.4" "2.5" "0" "Пикеты и плюсы")
(command "_text" "_m" "19,125" "3.5" "0" "МАСШТАБЫ:")
(setq MV_txt (RTOS (fix (* M_VER 1000)) 2 0))
(setq Mg_txt (RTOS (fix (* M_gor 1000)) 2 0))
(command "_text" "5,113" "3.5" "0" (strcat "МВ 1:" MV_txt))
(command "_text" "5,107" "3.5" "0" (strcat "МГ 1:" MG_txt))
(setq N_h (fix (- H_max (- HHH 1))))
(setq H_1 (list 55 100) Triger -1 HHH_i (+ HHH 1))
;Отpисовка веpтикальной линейки
(repeat N_h
(setq H_2 (DY H_1 (/ 1 M_ver)) H_3 (DX H_2 -2) H_4 (DX H_1 -2))
(command "_line" H_1 H_2 H_3 H_4 "")
(if (> Triger 0) (command "_line" (Dx H_1 -1) (Dx H_2 -1) ""))
(setq Triger (* Triger -1) H_txt (DX H_3 -7))
(command "_text" "_m" H_txt "3.5" "0" HHH_i )
(setq H_1 H_2 HHH_i (+ HHH_i 1))
);end repeat
;Пpоставление пикетов
(setq N_pk (fix (- End_pk Nach_pk -1)))
(setq N_pk_i Nach_pk Pk_htr_0 (list 60 10) N_Pk_i 0)
(setq PK_txt_i (fix (- Nach_pk 1)))
(repeat N_Pk
(setq Pk_htr_1 (Dx Pk_htr_0 (* N_pk_i (/ 100 M_gor))))
(setq Pk_htr_2 (DY Pk_htr_1 -1) Pk_txt (Dy Pk_htr_1 -2.5))
(command "_line" Pk_htr_1 Pk_htr_2 "")
(setq N_pk_i (+ N_pk_i 1) PK_txt_i (+ PK_txt_i 1))
(command "_text" "_m" Pk_txt "2.5" "0" PK_txt_i)
);end repeat
(command "_zoom" "_all")
);end defun SETKA
(Defun H_TABL ()
(if (= N_i_tbl 1) (progn
(setq PT1 (DXY P_tbl 10 10) P_tbl (DX P_tbl 50))
(setq PT2 (DXY PT1 -20 -320) PT3 (DX PT1 50))
(command "_stretch" "_C" PT1 PT2 "" PT1 PT3)
(setq P1 (DXY PT1 -80 -70) P2 (DX P1 47))
(setq P3 (DY P2 -15) P4 (DY P1 -15) P_T_0 P4)
(command "_line" P1 P2 P3 P4 P1 "")
(setq P1 (DX P4 12) P2 (DXY P4 12 15))
(command "_line" P1 P2 "")
(setq P1 (DX P4 27) P2 (DXY P4 27 15))
(command "_line" P1 P2 "")
(setq P_t_txt (DXY P4 6 7.5))
(command "_style" "" "" "0" "0.6" "0" "_n" "_n" "_n")
(command "_text" "_m" P_t_txt "3.5" "0" "Пикет")
(setq P_t_txt (DXY P4 19.5 7.5))
(command "_text" "_m" P_t_txt "3.5" "0" "Плюс")
(setq P_t_txt (DXY P3 -10 7.5))
(command "_text" "_m" P_t_txt "3.5" "0" "Отметка")
));end progn if
(if (= N_i_tbl 24) (progn (setq N_i_tbl 1)
(setq PT1 (DXY P_tbl 10 10) P_tbl (DX P_tbl 50))
(setq PT2 (DXY PT1 -20 -320) PT3 (DX PT1 50))
(command "_stretch" "_C" PT1 PT2 "" PT1 PT3)
(setq P1 (DXY PT1 -80 -70) P2 (DX P1 47))
(setq P3 (DY P2 -15) P4 (DY P1 -15) P_T_0 P4)
(command "_line" P1 P2 P3 P4 P1 "")
(setq P1 (DX P4 12) P2 (DXY P4 12 15))
(command "_line" P1 P2 "")
(setq P1 (DX P4 27) P2 (DXY P4 27 15))
(command "_line" P1 P2 "")
(setq P_t_txt (DXY P4 6 7.5))
(command "_style" "" "" "0" "0.6" "0" "_n" "_n" "_n")
(command "_text" "_m" P_t_txt "3.5" "0" "Пикет")
(setq P_t_txt (DXY P4 19.5 7.5))
(command "_text" "_m" P_t_txt "3.5" "0" "Плюс")
(setq P_t_txt (DXY P3 -10 7.5))
(command "_text" "_m" P_t_txt "3.5" "0" "Отметка")
));end progn if
(command "_style" "" "" "0" "0.8" "0" "_n" "_n" "_n")
(setq P1 (DY P_T_0 (* N_i_tbl -8)) P2 (DY P1 8))
(command "_line" P1 P2 "") (setq P2 (DX P1 47))
(command "_line" P1 P2 "") (setq P1 (DY P2 8))
(command "_line" P1 P2 "") (setq P1 (DX P2 -35) P2 (DY P1 8))
(command "_line" P1 P2 "") (setq P1 (DX P2 15) P2 (DY P1 -8))
(command "_line" P1 P2 "")
(setq P_t_txt (DXY P4 6 (+ (* N_i_tbl -8) 4)))
(command "_text" "_m" P_t_txt "2.5" "0" (rtos Pk_i_thk 2 0))
(setq P_t_txt (DXY P4 19.5 (+ (* N_i_tbl -8) 4)))
(command "_text" "_m" P_t_txt "2.5" "0" (rtos Pl_i_thk 2 2))
(setq P_t_txt (DXY P3 -10 (+ (* N_i_tbl -8) 4)))
(command "_text" "_m" P_t_txt "2.5" "0" (rtos H_i_thk 2 2))
(setq NNN N_i_tbl N_i_tbl (+ NNN 1))
);end defun h_tabl
(defun GORISONT ()
(command "_layer" "_set" "blue" "")
(setq POINT nil UR_1 nil UR_2 nil)
(setq DH_1 (- (cadr P_prev) H_rasch))
(setq DH_2 (- (cadr P_next) H_rasch))
(if (> DH_1 0.0) (setq UR_1 T));end if
(if (> DH_2 0.0) (setq UR_2 T));end if
(if (= UR_1 nil) (if (= UR_2 T) (setq POINT T)));end if if
(if (= UR_1 T) (if (= UR_2 nil) (setq POINT T)));end if if
(if (= UR_1 UR_2 nil) (progn
(if (= N_i_thk 2) (setq POINT T))
(if (= N_i_thk n_thk) (setq POINT T))
));end progn if
(if (= N_i_thk 2) (setq P_UR_i (list (car P_prev) H_rasch)));end if
(if (= N_i_thk n_thk) (setq P_UR_i (list (car P_next) H_rasch)));end if
(if (= POINT T) (progn
(if (= UR_1 T) (progn
(setq DX_UR (/ (* (- (car P_next) (car P_prev)) DH_1) (- (cadr P_prev) (cadr P_next))))
(setq P_UR_i (list (car (DX P_prev DX_UR)) H_rasch))));end progn if
(if (= UR_2 T) (progn
(setq DX_UR (/ (* (- (car P_next) (car P_prev)) DH_2) (- (cadr P_next) (cadr P_prev))))
(setq P_UR_i (list (car (DX P_next (* -1 DX_UR))) H_rasch))));end progn if
(setq N_THK_UR (+ N_THK_UR 1))
(if (= N_THK_UR 1) (setq UR_prev P_UR_i));end if
(if (= N_THK_UR 2) (progn (setq UR_next P_UR_i)
(command "_line" UR_prev UR_next "")
(setq L_UR (- (car UR_next) (car UR_prev)))
(if (> L_UR 20) (progn
(if (= TRIG_UR 0) (progn
(setq RUVV_TXT (strcat "РУВВ" RUVV_PROC "% " (rtos RUVV 2 2)))
(setq Pur (DXY UR_prev (/ L_UR 2) 7))
(command "_text" "_m" Pur "3.5" "0" RUVV_TXT)
(setq TRIG_UR 1)));end progn if trig_ur=0
));end progn if
(setq N_THK_UR 0)));end progn if n_thk_ur=2
));end progn if point=T
(command "_layer" "_set" "0" "")
);end defun gorisont
(defun init_stv ()
(setq Pk_i_thk (atof (substr line 2 9))) ;Пикет i-й точки
(setq PL_i_thk (atof (substr line 12 9))) ;Плюс i-й точки
(setq H_i_thk (atof (substr line 22 9))) ;Отметка i-й точки
);end defun init_stv
(defun init_uch ()
(setq N_i_uch (atof (substr line 2 9))) ;Hомеp участка
(setq N_nach (atof (substr line 12 9))) ;Hачало участка
(setq N_end (atof (substr line 22 9))) ;Конец участка
(setq K_cher (atof (substr line 32 9))) ;К-т шеpоховатости
(setq Uklon (atof (substr line 42 9))) ; % Уклона
(setq Kosina (atof (substr line 52 9))) ;Косина
);end defun init_uch
(defun init_rez ()
(setq Gi_i_uch (atof (substr line 12 9))) ;сpедняя глубина
(setq B_i_uch (atof (substr line 22 9))) ;шиpина участка
(setq S_i_uch (atof (substr line 32 9))) ;площадь сечения
(setq V_i_uch (atof (substr line 42 9))) ;сpедняя скоpость
(setq Q_i_uch (atof (substr line 52 9))) ;pасход
);end defun init_rez