(defun C:draw_insert_blocks_to_garden ( / t1 t2 t3 t4 t5 t6 с1 d dist dxf40 nd rd ns rs block_name_A put diam 1/m sk ss)
(geo_tools-help "draw_insert_blocks_to_garden")
  (if
    (not (tblobjname "block" "штриховка сад"))
    (load_annotative_bloks)
    )
  
  (initget)(setq t1(getpoint "\nУкажи первую точку:"))
  (initget)(setq t2(getpoint t1 "\nУкажи вторую точку:"))
  (initget)(setq t3(getpoint t2 "\nУкажи третью точку:"))
  (setq с1(+(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 с1 d)); вычисляю координаты на t4
  (setq t5(polar t4 (angle t2 t1) (distance t1 t2))); вычисляю координаты на t5
  (setq dist (/ 5 (getvar "CANNOSCALEVALUE")))
  (setq diam (/ 2 (getvar "CANNOSCALEVALUE")))
  (setq dxf41 (vl-list* 41 1))
  (setq dxf42 (vl-list* 42 1))
  (setq dxf43 (vl-list* 43 1))
  (setq nd (fix (/ (- (distance t1 t2) diam) dist)))
  (setq rd (rem (- (distance t1 t2) diam) dist))
  (setq ns (fix (/ (- (distance t1 t5) diam) dist)))
  (setq rs (rem (- (distance t1 t5) diam) dist))
  (setq t6 (polar t1 (angle t1 t5) (/ (+ rs diam) 2)))
  (setq ss (ssadd))
  (repeat (+ ns 1)
    (setq t6 (polar t6 (angle t1 t2) (/ (+ rd diam) 2)))
    (entmake (list '(0 . "INSERT") '(2 . "Штриховка сад") (append '(10) t6) dxf41 dxf42 dxf43))
    (ssadd (entlast) ss)
    (bump)
    (repeat nd
      (setq t6 (polar t6 (angle t1 t2) dist))
      (entmake (list '(0 . "INSERT") '(2 . "Штриховка сад") (append '(10) t6) dxf41 dxf42 dxf43))
      (ssadd (entlast) ss)
      (bump)
      )
    (setq t6 (polar t6 (angle t2 t1) (+ (* dist nd) (/ (+ rd diam) 2))))
    (setq t6 (polar t6 (angle t1 t5) dist))
    )
  (setvar "CMDECHO" 0)
  (vl-cmdf "-objectscale" ss "" "_Add" (getvar "CANNOSCALE") "")
  (command)
  (setvar "CMDECHO" 1)
;;;  (if
;;;    (not (= (getvar "CANNOSCALEVALUE") 1))
;;;    (progn
;;;      (setvar "cmdecho" 0)
;;;      (setq sk (getvar "CANNOSCALEVALUE"))
;;;      (command "CANNOSCALE" "1:1000")
;;;      (setq 1/m (rtos (* (/ 1 sk) 1000) 2 0))
;;;      (setq 1/m (strcat "1:" 1/m ))
;;;      (command "CANNOSCALE" 1/m)
;;;      (setvar "cmdecho" 1)
;;;      )
;;;    )
  (princ)
  )

(setq bcnt 0)
(defun bump (/)
  (princ
    (nth bcnt '("\r-" "\r\\" "\r|" "\r/"))
    )
  (setq bcnt (rem (1+ bcnt) 4))
  )