(defun C:export_cogo_points_to_kml ( / DESCRIPTION-STRING KATALOG-LIST LIST-DIALOG LIST_NUM_POINTS NUMBER-STRING POINT-LIST PUT-INPUT-FILE convert-sys-property)
  (load_global_variable)
  (geo_tools-help "export_cogo_points_to_be_file")
  (if
    C3D_active_document
    (progn
      
      (if (not(vl-catch-all-error-p(setq list_num_points (vl-catch-all-apply 'vlax-invoke (list C3D_active_document 'SelectPoints)))))
	(progn
	  (foreach num_point list_num_points
	    (setq C3D_point (vlax-invoke C3D_points 'find num_point))
	    (setq point-list
		   (append point-list
			   (list
			     (list
			       (list "name"(vlax-get C3D_point 'name))
			       (list "number"(itoa(vlax-get C3D_point 'number)))
			       (list "N"(vlax-get C3D_point 'northing))
			       (list "E"(vlax-get C3D_point 'easting))
			       (list "Z"(vlax-get C3D_point 'elevation))
			       (list "description"(vlax-get C3D_point 'RawDescription))
			       )))))
	  (setq put-input-file
		 (strcat
		   (getvar "DWGPREFIX")
		   (substr (getvar "DWGNAME") 1 (-(strlen (getvar "DWGNAME"))4))
		   "_"
		   (vlax-get (vlax-invoke C3D_points 'find (car list_num_points)) 'Layer)
		   )
		)
	  (setq convert-sys-property(dialog-print_to_png_area))
	  (if(setq put-input-file (getfiled "Имя сохраняемого файла..." put-input-file "kml" 1))
	    (progn
	      
	      (write-point-in-kml-file point-list put-input-file convert-sys-property)
	      ))
	  )
	)
      )
    (alert "Выполнение комманды предполагает ее запуск в AutoCAD Civil 3D!\nТекущий AutoCAD им не является или представляет собой не поддерживаемую(временно?) версию.")
    )
  (princ)
  )