ПЗ (1218806), страница 12
Текст из файла (страница 12)
(setq b1 15.812)
(setq b2 15.812)
(setq X (/ getE (sin alpha1)))
)
)
(if (and (= getPaths 2) (= getTypeR 1) (= getMark 0)) ; 210
(progn
(setq alpha1 0.0906601583674)
(setq alpha2 0.0906601583674)
(setq alpha_othervar1 3.05093249523)
(setq alpha_othervar2 3.05093249523)
(setq a1 14.475)
(setq a2 14.475)
(setq b1 19.054)
(setq b2 19.054)
(setq X (/ getE (sin alpha1)))
)
)
(if (and (= getPaths 2) (= getTypeR 1) (= getMark 1)) ; 211
(progn
(setq alpha1 0.110658722713)
(setq alpha2 0.110658722713)
(setq alpha_othervar1 3.03093393087)
(setq alpha_othervar2 3.03093393087)
(setq a1 15.459)
(setq a2 15.459)
(setq b1 15.602)
(setq b2 15.602)
(setq X (/ getE (sin alpha1)))
)
)
)
;--------------------диалоговое окно--------------------
(defun c:paral_sm (/ dcl_id getPaths getTypeR getMark getFirst getSecond getView getE)
(setq dcl_id
(load_dialog "C:/Users/Игорь/Desktop/diplom/group/Dialogs/parall_menu.dcl"))
(if (null (new_dialog "parallel" dcl_id))
(exit)
)
(action_tile "accept" "(def_par) (done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)")
(setq ddi (start_dialog))
(unload_dialog dcl_id)
(if (= ddi 1)
(main_par getPaths getTypeR getMark getView getFirst getSecond getE)
)
(princ)
)
;---------------------------------------------------------------
;---------Попутная укладка смежных стрелочных переводов-------
(defun main_pop(getTypePath getSpeed getTypeR getMark d / a1 a2 b1
b2 alpha1 alpha2 X p01 p02 p03 p04 p11 p22 osm ang)
(if (and (= getTypeR 0) (= getMark 0)) ;00 1\11 - 1\11
(progn
(setq a1 14.063)
(setq a2 14.063)
(setq b1 19.304)
(setq b2 19.304)
(setq alpha1 0.0906601583674)
(setq alpha2 0.0906601583674)
);end progn
);end if
(if (and (= getTypeR 0) (= getMark 1)) ; 01 1\11 - 1\9
(progn
(setq a1 14.063)
(setq a2 15.227)
(setq b1 19.304)
(setq b2 15.812)
(setq alpha1 0.0906601583674)
(setq alpha2 0.110658722713)
)
)
(if (and (= getTypeR 0) (= getMark 2)) ; 02 1\9- 1\11
(progn
(setq a1 15.227)
(setq a2 14.063)
(setq b1 15.812)
(setq b2 19.304)
(setq alpha1 0.110658722713)
(setq alpha2 0.0906601583674)
)
)
(if (and (= getTypeR 0) (= getMark 3)) ; 03 1/9 - 1/9
(progn
(setq a1 15.227)
(setq a2 14.063)
(setq b1 15.812)
(setq b2 19.304)
(setq alpha1 0.110658722713)
(setq alpha2 0.0906601583674)
)
)
(if (and (= getTypeR 1) (= getMark 0)) ; 10 1\11 - 1\11
(progn
(setq a1 14.475)
(setq a2 14.475)
(setq b1 19.054)
(setq b2 19.054)
(setq alpha1 0.0906601583674)
(setq alpha2 0.0906601583674)
)
)
(if (and (= getTypeR 1) (= getMark 1)) ; 11 1\11 - 1\9
(progn
(setq a1 14.475)
(setq a2 15.459)
(setq b1 19.054)
(setq b2 15.602)
(setq alpha1 0.0906601583674)
(setq alpha2 0.110658722713)
)
)
(if (and (= getTypeR 1) (= getMark 2)) ; 12 p50 - 1/9 - 1/11
(progn
(setq a1 15.459)
(setq a2 14.475)
(setq b1 15.602)
(setq b2 19.054)
(setq alpha1 0.110658722713)
(setq alpha2 0.0906601583674)
)
)
(if (and (= getTypeR 1) (= getMark 3)) ; 13 1/9 - 1/9
(progn
(setq a1 15.459)
(setq a2 15.459)
(setq b1 15.602)
(setq b2 15.602)
(setq alpha1 0.110658722713)
(setq alpha2 0.110658722713)
)
)
(setq X (+ b1 d a2))
(setq ang (getangle "Укажите угол"))
(setq p02 (getpoint "Укажите место отрисовки"))
(setq p01 (polar p02 ang (- a1))) ; center
(setq p03 (polar p02 ang X)) ; center
(setq p04 (polar p03 ang b2))
(setq p11 (polar p02 (+ ang alpha1) (+ b1 d)))
(setq p22 (polar p03 (+ ang (- alpha2)) b2))
(setq center1 (polar p02 (+ (/ pi 2) ang) 1))
(setq center2 (polar p02 (- (/ (* 3 pi) 2) (- ang)) 1))
(setq center3 (polar p03 (+ (/ pi 2) ang) 1))
(setq center4 (polar p03 (- (/ (* 3 pi) 2) (- ang)) 1))
(setq osm (getvar "osmode"))
(command "PLINEWID" getWidthSmezhStr)
(setvar "OSMODE" 0)
(command "_.pline" center1 center2 "")
(command "_.pline" center3 center4 "")
(command "_pline" p01 p02 p03 p04 "")
(command "_pline" p02 p11 "")
(command "_pline" p03 p22 "")
(setvar "OSMODE" 1)
)
(defun def_pop ()
(setq getTypePath (atoi (get_tile "type_paths_pop")))
(setq getSpeed (atoi (get_tile "speed_pop")))
(setq getTypeR (atoi (get_tile "type_r_pop")))
(setq getMark (atoi (get_tile "mark_two_pop")))
(if (and (= getTypePath 0) (= getSpeed 0)) ; 00
(setq d 12.5)
);end if
(if (and (= getTypePath 0) (= getSpeed 1)) ; 01
(setq d 25.0)
);end if
(if (and (= getTypePath 1) (= getSpeed 0)) ; 10
(setq d 6.25)
);end if
(if (and (= getTypePath 1) (= getSpeed 1)) ; 11
(setq d 6.25)
);end if
(if (and (= getTypePath 2) (= getSpeed 0)) ; 20
(setq d 4.5)
);end if
(if (and (= getTypePath 2) (= getSpeed 1)) ; 21
(setq d 4.5)
);end if
); end defun def()
;------------------диалоговое окно------------------------
(defun c:pop_sm(/ dcl_id getTypePath getSpeed getTypeR getMark d)
(setq dcl_id (load_dialog "C:/Users/Игорь/Desktop/diplom/group/Dialogs/poput_menu.dcl")
)
(if (null (new_dialog "poput" dcl_id))
(exit)
)
(action_tile "accept" "(def_pop) (done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)")
(setq ddi (start_dialog))
(unload_dialog dcl_id)
(if (= ddi 1)
(main_pop getTypePath getSpeed getTypeR getMark d)
)
(princ)
)
;-----------------------------------------------------
;---------------Встречная укладка смежного перевода-------------
(defun main_vst(getTypePath getSpeed getTypeR
getMark d / a1 a2 b1 b2 alpha1 alpha2 X p01 p02 p03 p04 p11 p22 PSize PS ang )
(if (and (= getTypeR 0) (= getMark 0)) ; 00 1\11 - 1\11
(progn
(setq a1 14.063)
(setq a2 14.063)
(setq b1 19.304)
(setq b2 19.304)
(setq alpha1 0.0906601583674)
(setq alpha2 0.0906601583674)
)
)
(if (and (= getTypeR 0) (= getMark 1)) ; 01 1\11 - 1\9
(progn
(setq a1 14.063)
(setq a2 15.227)
(setq b1 19.304)
(setq b2 15.812)
(setq alpha1 0.0906601583674)
(setq alpha2 0.110658722713)
)
)
(if (and (= getTypeR 0) (= getMark 2)) ; 02 1\9 - 1\9
(progn
(setq a1 15.227)
(setq a2 15.227)
(setq b1 15.812)
(setq b2 15.812)
(setq alpha1 0.110658722713)
(setq alpha2 0.110658722713)
)
)
(if (and (= getTypeR 1) (= getMark 0)) ; 10 p50 - 1/11 - 1/11
(progn
(setq a1 14.475)
(setq a2 14.475)
(setq b1 19.054)
(setq b2 19.054)
(setq alpha1 0.0906601583674)
(setq alpha2 0.0906601583674)
)
)
(if (and (= getTypeR 1) (= getMark 1)) ; 11 p50 - 1/11 - 1/9
(progn
(setq a1 14.475)
(setq a2 15.459)
(setq b1 19.054)
(setq b2 15.602)
(setq alpha1 0.0906601583674)
(setq alpha2 0.110658722713)
)
)
(if (and (= getTypeR 1) (= getMark 2)) ; 12 p50 - 1/9 - 1/9
(progn
(setq a1 15.459)
(setq a2 15.459)
(setq b1 15.602)
(setq b2 15.602)
(setq alpha1 0.110658722713)
(setq alpha2 0.110658722713)
)
)
(setq X (+ a1 d a2))
(setq ang (getangle "Укажите угол"))
(setq p02 (getpoint "Укажите место отрисовки")) ; центр стр.пер 1
(setq p01 (polar p02 ang (- b1)))
(setq p11 (polar p02 (+ ang alpha1) (- b1))) ; !!!
(setq p03 (polar p02 ang X)) ; центр стр.пер 2
(setq p22 (polar p03 (+ ang alpha2) b2))
(setq p04 (polar p03 ang b2))
(setq center1 (polar p02 (+ (/ pi 2) ang) 1))
(setq center2 (polar p02 (- (/ (* 3 pi) 2) (- ang)) 1))
(setq center3 (polar p03 (+ (/ pi 2) ang) 1))
(setq center4 (polar p03 (- (/ (* 3 pi) 2) (- ang)) 1))
(setq po (getvar "osmode"))
(setvar "osmode" 0)
(command "PLINEWID" getWidthSmezhStr)
(command "_.pline" center1 center2 "")
(command "_.pline" center3 center4 "")
(command "_pline" p01 p02 p03 p04 "")
(command "_pline" p02 p11 "")
(command "_pline" p03 p22 "")
(setvar "osmode" 1)
)
(defun def_vst ()
(setq getTypePath (atoi (get_tile "type_paths_vst")))
(setq getSpeed (atoi (get_tile "speed_vst")))
(setq getTypeR (atoi (get_tile "type_r_vst")))
(setq getMark (atoi (get_tile "mark_two")))
(if (and (= getTypePath 0) (= getSpeed 0)) ; 00
(setq d 12.5)
) ; end if
(if (and (= getTypePath 0) (= getSpeed 1)) ; 01
(setq d 25.0)
) ; end if
(if (and (= getTypePath 1) (= getSpeed 0)) ; 10
(setq d 12.5) ; d = 6.25 (б)
) ; end if
(if (and (= getTypePath 1) (= getSpeed 1)) ; 11
(setq d 12.5)
) ; end if
(if (and (= getTypePath 2) (= getSpeed 0)) ; 20
(setq d 0)
) ; end if
(if (and (= getTypePath 2) (= getSpeed 1)) ; 21
(setq d 0)
) ; end if
)
(defun c:dialog_sm (/ dcl_id getTypePath getSpeed getTypeR getMark)
(setq dcl_id
(load_dialog
"C:/Users/Игорь/Desktop/diplom/group/Dialogs/vstrech_menu.dcl"
)
)
(if (null (new_dialog "smezh_vstr" dcl_id))
(exit)
)
(action_tile "accept" "(def_vst) (done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)")
(setq ddi (start_dialog))
(unload_dialog dcl_id)
(if (= ddi 1)
(main_vst getTypePath getSpeed getTypeR getMark d)
)
(princ)
)
;--------------------------------------------------------
;----------------предельный столбик------------------------
(defun c:stolb_easy (/)
(setq osm (getvar "osmode"))
(setvar "osmode" 0)
(setq u1 (getpoint "\nГде установить? "))
(command "_.circle" u1 0.2)
(setq l1 (entlast))
(command "_.hatch" "solid" l1 "")
(setvar "osmode" 7)
)
;-----------------------------------------------------------
;-----------нумерация ЦСП-------------------------------
(defun c:CSP (/)
(setq csp_point
(getpoint "\nПожалуйста, выберите местоположение центра стрелочного перевода: ") )
(setq c1 (polar csp_point (/ pi 2) 1))
(setq c2 (polar csp_point (/ (* 3 pi) 2) 1))
(setq osm (getvar "OSMODE"))
(command "PLINEWID" 0.1)
(setvar "OSMODE" 0)
(command "_.pline" c1 c2 "")
(setvar "OSMODE" 4)
)
(defun num_CSP (getTypeNum / n XY number angle_txt)
(setq angle_txt 1.91986217719)
(if (= getTypeNum 0)
(progn
(setq n 2)
(while (<= n getMaxNum)
(setq XY (getpoint "\nВыберите центр стрелочного перевода: "))
(setq number (polar XY angle_txt 2))
(command "_text" number getSizeSymbols (angtos 0) n "")
(setq n (+ n 2))
(if (> n getMaxNum)
(alert "Нумерация окончена")
)
)
)
); end if
(if (= getTypeNum 1)
(progn
(setq n 1)
(while (<= n getMaxNum)
(setq XY (getpoint "\nВыберите центр стрелочного перевода: "))
(setq number (polar XY angle_txt 2))
(command "_text" number getSizeSymbols (angtos 0) n "")
(setq n (+ n 2))
(if (> n getMaxNum)
(alert "Нумерация окончена")
)
)
)
)
)
(defun num_CSP_opr ()
(setq getTypeNum (atoi (get_tile "num_type")))
)
(defun c:dialog_num_CSP (/ dcl_id getTypeNum)
(setq dcl_id
(load_dialog
"C:/Users/Игорь/Desktop/diplom/group/Dialogs/num_csp.dcl"
)
)
(if (null (new_dialog "numberCSP" dcl_id))
(exit)
)