(defun draw_profil_rasst (2Dpline t0! q_sel_v_pr mg / t0 n spisokv t1_draw_rasst t2_draw_rasst ht styl t1 t2 t3 tp1 tp2 n S list_points mleader_obj ang hs pt_array)
	 (setq spisokv(extract_coord_lwpolyline (entget 2Dpline)))
	 (setq n (1- (length spisokv)))
	 (setq t0 t0!)
	 (cond
	   ((= q_sel_v_pr 0)
	    (setq t1_draw_rasst(mapcar '- t0! (list 0 (/ 90 (/ 1000 mg)))))
	    (setq t2_draw_rasst(mapcar '- t0! (list 0 (/ 80 (/ 1000 mg)))))
	    (setq ht (/ 3.5 (/ 1000 mg)))
	    (setq styl (getvar "TEXTSTYLE"))
	    )
	   ((= q_sel_v_pr 1)
	    (setq t1_draw_rasst(mapcar '- t0! (list 0 (/ 90 (/ 1000 mg)))))
	    (setq t2_draw_rasst(mapcar '- t0! (list 0 (/ 80 (/ 1000 mg)))))
	    (setq ht (/ 3.5 (/ 1000 mg)))
	    (setq styl (getvar "TEXTSTYLE"))
	    )
	   ((= q_sel_v_pr 2)
	    (setq t1_draw_rasst(mapcar '- t0! (list 0 (/ 65 (/ 1000 mg)))))
	    (setq t2_draw_rasst(mapcar '- t0! (list 0 (/ 55 (/ 1000 mg)))))
	    (setq ht (/ 3.5 (/ 1000 mg)))
	    (setq styl (getvar "TEXTSTYLE"))
	    )
	   ((= q_sel_v_pr 4)
	    (setq t1_draw_rasst(mapcar '- t0! (list 0 (/ 115 (/ 1000 mg)))))
	    (setq t2_draw_rasst(mapcar '- t0! (list 0 (/ 105 (/ 1000 mg)))))
	    (setq ht (/ 2.5 (/ 1000 mg)))
	    (setq styl (getvar "TEXTSTYLE"))
	    )
	   ((= q_sel_v_pr 5)
	    (setq t1_draw_rasst(mapcar '- t0! (list 0 (/ 90 (/ 1000 mg)))))
	    (setq t2_draw_rasst(mapcar '- t0! (list 0 (/ 80 (/ 1000 mg)))))
	    (setq ht (/ 3.5 (/ 1000 mg)))
	    (setq styl (getvar "TEXTSTYLE"))
	    )
	   )
	 (if (= q_chek_v_pr 0)
	   (progn
	     (initget)(setq t1_draw_rasst(getpoint "\nУкажи нижнюю линию строки расстояния: "))
	     (initget)(setq t2_draw_rasst(getpoint "\nУкажи верхнюю линию строки расстояния: "))
	     (setq ht (/ 3.5 (/ 1000 mg)))
	     (setq styl (getvar "TEXTSTYLE"))
	     )
	   )
	 (setq hs (- (nth 1 t2_draw_rasst)(nth 1 t1_draw_rasst)))
	 (repeat n
	   (setq p1 (car spisokv))
	   (setq tp1 t0)
	   (setq spisokv (cdr spisokv))
	   (setq p2 (car spisokv))
	   (setq tp2 (mapcar '+ t0 (list (- (nth 0 p2) (nth 0 p1)) 0 0)))
	   (setq s (rtos (- (nth 0 p2) (nth 0 p1)) 2 2))
	   (if (/= (- (nth 0 p2) (nth 0 p1)) 0)
	     (progn
	       (setq t1 (list (nth 0 p1) (nth 1 t1_draw_rasst)))
	       (setq t2 (list (nth 0 p2) (nth 1 t1_draw_rasst)))
	       (if
		 (>
		   (+ (/ 1.6 (/ 1000 mg))(/ (* 1.6 (/ 2 3)) (/ 1000 mg)))
		   (distance t1 t2)); условие
		 (progn
		   (setq t3 (mapcar '+ t1 (list (/(distance t1 t2)2) (/ hs 4) )))
		   (setq list_points (list t3 (mapcar '+ t3 (list (/ 2 (/ 1000 mg)) (/ -7 (/ 1000 mg))))))
		   (setq pt_array (convert_coords_list_from_safearray_mleader list_points))
		   (setvar "CMLEADERSTYLE" "Подписи")
		   (setq mleader_obj (vla-addmleader model_spece pt_array 0))
		   (vla-put-StyleName mleader_obj "Подписи")
		   (vla-put-textstring mleader_obj S)
		   (vla-put-TextHeight mleader_obj (/ 2.5 (/ 1000 mg)))
		   )
		 (progn
		   (if
		     (< (+(calculation_str_long_be_h_stile S ht styl)(/ (* 1.6(/ 2 3)) (/ 1000 mg))) (distance t1 t2))
		     (progn
		       (setq ht (/ 3.5 (/ 1000 mg)))
		       (setq ang 0)
		       )
		     (progn
		       (setq ang (/ pi 2))
		       (if
			 (< (+(/ 3.5 (/ 1000 mg))(/ (* 3.5 0.6) (/ 1000 mg)))(distance t1 t2))
			 (setq ht (/ 3.5 (/ 1000 mg)))
			 (setq ht (* (distance t1 t2) 0.6))
			 )
		       )
		     ); if
		   (entmake (list '(0 . "TEXT")
				  (cons 10 t1)
				  '(72 . 4)
				  (cons 11 (mapcar '+ t1 (list (/(distance t1 t2)2) (/ hs 2) )))
				  (cons 40 ht)
				  (cons 50 ang)
				  (cons 1 S)
				  (cons 7 styl)
				  )
			    )
		   ); progn
		 ); if
	       (if (= q_sel_v_pr 4)(entmake (list '(0 . "LINE") '(6 . "Continuous") (cons 10 (list (nth 0 t0)(nth 1 t1_draw_rasst)0)) (cons 11 (list (nth 0 t0)(nth 1 t2_draw_rasst)0)))))
	       )
	     )
	   (setq t0 (mapcar '+ t0 (list (- (nth 0 p2) (nth 0 p1)) 0 0)))
	   )
	 )
