(defun C:convert_txt_to_kml( / FILE_POINTS_LIST LIST-STRINGS LIST_POINTS_LIST PUT-FILE )
  ;Импортирует точки из файла, форматов Nikon PNEZD,CDR33,GSI
  (load_global_variable)
  (if(setq put-file (getfiled "Выбор файла координат" (getvar "DWGPREFIX")  "txt" 0))
    (progn
      (setq file_points_list(file_read_to_list put-file))
      (foreach x file_points_list
	(setq list_points_list (append list_points_list (list (convert-string-to-list-be-delimiter x ","))))
	)
      (princ list_points_list)
      (setq list-strings (list
			   "<?xml version=\"1.0\" encoding=\"windows-1251\"?>"
			   "<kml xmlns=\"http://earth.google.com/kml/2.2\">"
			   "<Document>"
			   )
	    )
      (foreach z list_points_list
	(setq list-strings
	       (append list-strings
		       (list
			 (strcat"  <Placemark><name>"(nth 0 z)
				"</name><Point><coordinates>"
				(nth 2 z) "," (nth 1 z)
				",0.000000</coordinates></Point></Placemark>")
			 )
		       )
	      )
	)
      (setq list-strings
	     (append list-strings
		     (list
		       "</Document>"
		       "</kml>"
		       )
		     )
	    )
      (if(setq put-file (getfiled "Имя сохраняемого файла..." put-file "kml" 1))
	    (file_write_list_to_file put-file list-strings))
      
      )
    )
  
  
  (princ)
  )