(defun C:draw_stairs_be_3_points ( / c1 current-stup d dist n stup t-a t-b t1 t2 t3 t4 t5)
  ; лесница по трем точкам
  (initget 1)(setq t1 (getpoint(strcat "\nУкажи первую точку: ")))
  (if t1
    (progn
      (initget 1)(setq t2(getpoint t1 "\nУкажи вторую точку по линии спуска/подъема:"))
      (vla-StartUndoMark active_document)
      (entmake (list '(0 . "LINE") (cons 10 t1) (cons 11 t2)))
      (initget 1)(setq t3(getpoint t2 "\nУкажи третью точку (ширина лестницы):"))
      (setq c1(+(angle t2 t1) (/ pi 2))); вычисляю угол на t4
      (setq d(*(distance t2 t3) (cos (- pi (- (- (angle t2 t1)(angle t2 t3)) (/ pi 2)))))); вычисляю расстояние на t4
      (setq t4(polar t2 c1 d)); вычисляю координаты на t4
      (setq t5(polar t4 (angle t2 t1) (distance t1 t2))); вычисляю координаты на t5
      (entdel (entlast))
      (draw-lwpolyline-vla-by-list-property
	(list(cons "spece" (if (eq (getvar "CTAB")"Model")model_spece paper_spece))
	     (cons "Coordinates" (list t1 t2 t4 t5))
	     (cons "Closed" -1)
	     ))
      (setq dist (atof(rtos (distance t1 t2) 2 3)))
      (setq stup (/ 0.50 (format_scale_kof)))
      (setq n (fix(/ dist stup)))
      (terpri)
      (princ "dist=")
      (princ (rtos dist 2 16))
      (terpri)
      (princ "n=")
      (princ n)
      (terpri)
      (princ "остаток=")
      (princ (rtos (*(- (/ dist stup)n) stup)2 16))
      (terpri)
      
;;;      (princ(/ 0.40 (format_scale_kof)))
;;;      (terpri)
      
      (if (= (rem dist stup) 0.0)
	(progn
	  (setq n (- n 2))
	  (setq current-stup stup)
	  (princ "целое")
	  )
	(progn
	  (setq n (1- n))
	  (setq current-stup (*(/ (- (/ dist stup) n)2.0)stup))
	  (princ "с остатком")
	  )
	)
      
      (repeat (1+ n)
	(setq t-a(polar t1 (angle t1 t2) current-stup))
	(setq t-b(polar t5 (angle t5 t4) current-stup))
	(setq current-stup (+ current-stup stup))
	(draw-lwpolyline-vla-by-list-property
	  (list(cons "spece" (if (eq (getvar "CTAB")"Model")model_spece paper_spece))
	       (cons "Coordinates" (list t-a t-b))
	       ))
	)
      
      (vla-EndUndoMark active_document)
      )
    )
  
  (princ)
  )