(defun C:error_circle ( / put-file point list-points list-dialog color)
  (load_global_variable)
  (if (setq list-dialog(dialog-error-circle))
    (if (setq put-file (getfiled "Выбор файла" (getvar "DWGPREFIX")  "txt" 0))
      (progn
	(foreach x (file_read_to_list put-file)
	  (setq point (convert-string-to-list-be-delimiter x " "))
	  (setq list-points(append list-points(list(list(atof (nth 0 point))(atof (nth 1 point))(atof (nth 2 point))))))
	  )
	(princ "\nMax=")
	(princ(apply 'max(apply 'append (mapcar 'list (mapcar 'car list-points)))))
	(princ "\nMin=")
	(princ(apply 'min(apply 'append (mapcar 'list (mapcar 'car list-points)))))
	(foreach x list-points
	  (setq color
		 (cond
		   ((< (nth 0 x) (get-item-by-name-in-list list-dialog "level1"))
		    (get-item-by-name-in-list list-dialog "color1")
		    )
		   ((< (nth 0 x) (get-item-by-name-in-list list-dialog "level2"))
		    (get-item-by-name-in-list list-dialog "color2")
		    )
		   ((< (nth 0 x) (get-item-by-name-in-list list-dialog "level3"))
		    (get-item-by-name-in-list list-dialog "color3")
		    )
		   ((< (nth 0 x) (get-item-by-name-in-list list-dialog "level4"))
		    (get-item-by-name-in-list list-dialog "color4")
		    )
		   ((< (nth 0 x) (get-item-by-name-in-list list-dialog "level5"))
		    (get-item-by-name-in-list list-dialog "color5")
		    )
		   ((< (nth 0 x) (get-item-by-name-in-list list-dialog "level6"))
		    (get-item-by-name-in-list list-dialog "color6")
		    )
		   (T
		    0)
		   )
		)
;;;	  (princ "\n")
;;;	  (princ(nth 0 x))
;;;	  (princ " ")
;;;	  (princ color)
	  (draw-circle-vla-by-list-property
	    (list
	      (cons "spece" model_spece)
	      (cons "InsertionPoint" (list  (nth 2 x) (nth 1 x)0))
	      (cons "Radius" (*(nth 0 x)(get-item-by-name-in-list list-dialog "syze")))
	      (cons "Color" color)
	      ))
	  (draw-circle-vla-by-list-property
	    (list
	      (cons "spece" model_spece)
	      (cons "InsertionPoint" (list  (nth 2 x) (nth 1 x)0))
	      (cons "Radius" 0.1)
	      (cons "Color" color)
	      ))
	  )
	)
      )
    )
  (princ)
  )


(defun dialog-error-circle (/ dcl_id list-dialog temp-list flag)
  (if (not(setq list-dialog(vlax-ldata-get "geo_tools_dictionary" "dialog-error-circle")))
    (setq list-dialog (list
			(list "syze" 1000)
			(list "level1" 100)
			(list "level2" 200)
			(list "level3" 300)
			(list "level4" 400)
			(list "level5" 500)
			(list "level6" 500)
			(list "color1" 1)
			(list "color2" 2)
			(list "color3" 3)
			(list "color4" 4)
			(list "color5" 5)
			(list "color6" 6)
			)
	  )
    )
  (setq dcl_id (geo-tools-load-dialog "error_circle"))
  (new_dialog "error_circle" dcl_id)
  (foreach x list-dialog(set_tile (car x)
				  (if (= (ascii(car x))(ascii"c"))
				    (itoa(cadr x))
				    (rtos(cadr x))
				    )
				  )
    )
  (action_tile "accept"
    (vl-prin1-to-string
      '(progn
	(foreach x list-dialog
	 (setq temp-list (append temp-list (list (list (car x)
						  (if (= (ascii(car x))(ascii"c"))
						   (atoi(get_tile (car x)))
						   (atof(get_tile (car x)))
						   )
						  ))))
	 )
	(setq list-dialog temp-list)
	(setq flag T)
	(done_dialog)
	)
      )
    )
  (start_dialog)
  (unload_dialog dcl_id)
  (if flag
    (vlax-ldata-put "geo_tools_dictionary" "dialog-error-circle" list-dialog)
    (setq list-dialog nil)
    )
  list-dialog
  )