(defun dialog-import-cogo-points (/ dcl_id last-selekt result last-selekt list-dialog-import-cogo-points last-selekt template)
  ; диалог параметров импортируемого файла и настроек вставки
  (defun mode_tile-flag (/ list-toggle)
    (setq list-toggle(list "upload" "input" "calculation" "unknown" "layer-name"))
    (if (= (get_tile "format") "0")
      (foreach x list-toggle
	(mode_tile x 0))
      (foreach x list-toggle
	(mode_tile x 1)
	))
    (if (and (= (get_tile "format") "0")(= (get_tile "layer-name") "1"))
      (mode_tile "layer-name_base" 1)
      (mode_tile "layer-name_base" 0)
      )
    
    (if (/= (get_tile "format") "0")
      (mode_tile "layer-name_base" 0)
      )
    (if (= (get_tile "insert-bloks") "1")
      (mode_tile "nabor-keys" 0)
      (mode_tile "nabor-keys" 1)
      )
    )
  
  (setq dcl_id (geo-tools-load-dialog "d_import_cogo_points"))
  (setq template
	 (list
	   (list "upload" "0")
	   (list "input" "0")
	   (list "calculation" "1")
	   (list "unknown" "1")
	   (list "layer-name" "1")
	   (list "format" "0")
	   (list "layer-name_base" "1")
	   (list "insert-bloks" "0")
	   (list "nabor-keys" "0")
	   ))
  (if (not(setq list-dialog-import-cogo-points (vlax-ldata-get "geo_tools-data-dialogs" "dialog-import-cogo-points")))
    (setq list-dialog-import-cogo-points template)
    (if(not(get-item-by-name-in-list list-dialog-import-cogo-points "layer-name_base"))
      (setq list-dialog-import-cogo-points template)))
  (new_dialog "d_import_cogo_points" dcl_id)
  (start_list "nabor-keys")
  (foreach x (get-list-keys) (add_list x))
  (end_list)
  (foreach y list-dialog-import-cogo-points
    (set_tile (car y) (cadr y)))
  
  (mode_tile-flag)
  (action_tile "format"(vl-prin1-to-string'(mode_tile-flag)))
  (action_tile "layer-name_base"(vl-prin1-to-string'(mode_tile-flag)))
  (action_tile "layer-name"(vl-prin1-to-string'(mode_tile-flag)))
  (action_tile "insert-bloks"(vl-prin1-to-string'(mode_tile-flag)))
  (action_tile "accept"
    (vl-prin1-to-string
      '(progn
	(foreach x list-dialog-import-cogo-points
	 (setq result(append result (list (list (car x)(get_tile (car x))))))
	 )
	(done_dialog 1)
	)))
  (start_dialog)
  (unload_dialog dcl_id)
  (if result(vlax-ldata-put "geo_tools-data-dialogs" "dialog-import-cogo-points" result))
  result
  )
