(defun C:get-number-by-point (/ BIG_LIST FLAG-1 LIST-POINTS N NABOR NABOR-POINTS NABOR-TEXT NEW-POINT DIST LIST-DIST NU)
  (load_global_variable)
  (setq nabor-points(ssget "_X" '((0 . "POINT"))))
  (setq nabor-points(convert_ss_to_list nabor-points))
  (setq nabor-text(ssget "_X" '((0 . "TEXT"))))
  (setq nabor-text(convert_ss_to_list nabor-text))
  (setq nabor(convert_ss_to_list nabor))
  (setq nu 0)
  (foreach x nabor-points
    (setq flag-1 nil)
    (setq n 0)
    (setq list-dist nil)
    (while (not flag-1)
      (setq dist (distance (get-pointtext-by-ent-obj(nth n nabor-text))(get-point-by-ent-obj x)))
      (setq list-dist (append list-dist (list (rtos dist 2 3))))
      (if (< (distance (get-pointtext-by-ent-obj(nth n nabor-text))(get-point-by-ent-obj x)) 20.0)
	(progn
	  
	  (setq new-point (append (get-point-by-ent-obj x) (list(get-texttext-by-ent-obj (nth n nabor-text)))))
	  (setq flag-1 T)
	  )
	(setq n (1+ n))
	)
      (if (> n (1-(length nabor-text)))
	(progn
	  (setq new-point (append (get-point-by-ent-obj x) (list "hz")))
	  (setq flag-1 T)
	  )
	)
      )
    (setq list-points (append list-points (list  new-point)))
    (file_write_list_to_file (strcat "d:\\"(itoa nu)".txt") (acad_strlsort list-dist))
    (setq nu (1+ nu))
    )
  (foreach y list-points
    (setq big_list (append big_list (list (strcat (nth 3 y)","(rtos(nth 1 y)2 3)","(rtos(nth 0 y)2 3)))))
    )
  (file_write_list_to_file "d:\\point_list.txt" big_list)
  (princ)
  )

(defun get-pointtext-by-ent-obj (obj / point)
  (setq point (cdr (assoc 10 (entget obj))))
  (list (nth 0 point)(nth 1 point) 0.0)
  )
(defun get-texttext-by-ent-obj (obj / point)
  (cdr (assoc 1 (entget obj)))
  )


;;;(distance (get-pointtext-by-ent-obj(car (entsel)))(get-pointtext-by-ent-obj(car (entsel))))

