(defun C:draw_сoor_krest (/ sk krest-dist max-x max-y min-x min-y point1 point2 temp-y temp-x flag cur-str-temp-x list-coor-krest str-list 1/m ss)
  ; заполняет область координатными крестами по двум точкам
  (setq sk (getvar "CANNOSCALEVALUE"))
  (setq krest-dist (/ 100.0 sk))
  (if(setq point1 (getpoint "\nУкажи первую точку диагонали:"))
    (if (setq point2 (getpoint point1 "\nУкажи вторую точку диагонали:"))
      (progn
	(setq max-x (max (nth 0 point1)(nth 0 point2)))
	(setq min-x (min (nth 0 point1)(nth 0 point2)))
	(setq max-y (max (nth 1 point1)(nth 1 point2)))
	(setq min-y (min (nth 1 point1)(nth 1 point2)))
	
	(setq temp-y(*(atof(rtos (/ min-y krest-dist) 2 0))krest-dist))
	(if (< temp-y min-y) (setq temp-y (+ temp-y krest-dist)))
	(if (< temp-y max-y)
	  (progn
	    (if
	      (not (tblobjname "block" "Крест сетки"))
	      (load_annotative_bloks)
	      )
	    (setq temp-x(*(atof(rtos (/ min-x krest-dist) 2 0))krest-dist))
	    (if (< temp-x min-x) (setq temp-x (+ temp-x krest-dist)))
	    (if (< temp-x max-x)
	      (progn
		(setq str-list (list temp-y))
		(while (not flag)
		  (setq temp-y (+ temp-y krest-dist))
		  (if (< temp-y max-y) (setq str-list (append str-list (list temp-y))) (setq flag T))
		  )
		
		(foreach y str-list
		  (setq cur-str-temp-x temp-x)
		  (setq flag nil)
		  (setq list-coor-krest (append list-coor-krest (list (list cur-str-temp-x y))))
		  (while (not flag)
		    (setq cur-str-temp-x (+ cur-str-temp-x krest-dist))
		    (if (< cur-str-temp-x max-x) (setq list-coor-krest (append list-coor-krest (list(list cur-str-temp-x y)))) (setq flag T))
		    )
		  )
		(setq ss (ssadd))
		(foreach x list-coor-krest
		  (entmake (list '(0 . "INSERT") '(2 . "Крест сетки") (append '(10) x) (vl-list* 41 1) (vl-list* 42 1) (vl-list* 43 1)))
		  (ssadd (entlast) ss)
		  )
		(setvar "CMDECHO" 0)
		(vl-cmdf "-objectscale" ss "" "_Add" (getvar "CANNOSCALE") "")
		(command)
		(setvar "CMDECHO" 1)
		)
	      )
	    )
	  (alert "В указаную область не попадает ни одино перекрестье сетки в данном масштабе.")
	  )
	)
      )
    )
  (princ)
  )