(defun C:insert_relief_point ( / elevation flag h-text options t1)
  ; вставка пикета (блок) с отметкой (текст) и возможностью поместить его на эту отметку.
  (geo_tools-help "insert_relief_point")
  (setq h-text (/ 2.0 (getvar "CANNOSCALEVALUE")))
;;;  (setq style-text
;;;	 (if
;;;	   (not (tblobjname "style" "Древний курсив (Д-431)"))
;;;	   (getvar "TEXTSTYLE")
;;;	   "Древний курсив (Д-431)"
;;;	   )
;;;	)
  (setq style-text (getvar "TEXTSTYLE"))
  
  (if (not (setq options (vlax-ldata-get "geo_tools_dictionary" "insert_relief_point")))
    (setq options (list (list "draw-elevation" "0")(list "3d-block" "0")(list "3d-elevation" "0")(list "accuracy-elevation" "2"))))
  (while (not flag)
    (initget "Настройки Выход")
    (setq t1 (getpoint(strcat "\nУкажи точку вставки [Настройки/Выход]<Выход>: ")))
    (cond
      ((or (= t1 nil)(= t1 "Выход"))
       (setq flag T)
       )
      ((= t1 "Настройки")
       (setq options (dialog-insert-relief-point options))
       (vlax-ldata-put "geo_tools_dictionary" "insert_relief_point" options)
       )
      (T
       (if (/=(get-item-by-name-in-list options "draw-elevation")"0")
	 (progn
	   (initget 1)(setq elevation(getreal "\nВведи отметку точки: "))
	   )
	 )
       (vla-StartUndoMark active_document)
       
       (draw-insertblock-vla-by-list-property
	 (list(cons "spece" (if (eq (getvar "CTAB")"Model")model_spece paper_spece))
	      (cons "InsertionPoint"
		    (list (nth 0 t1) (nth 1 t1)
			  (if (and(/=(get-item-by-name-in-list options "draw-elevation")"0")(/=(get-item-by-name-in-list options "3d-block")"0"))
			    elevation 0.0)))
	      (cons "EffectiveName" "Пикет")
	      (cons "XScaleFactor" 1.0)
	      (cons "YScaleFactor" 1.0)
	      (cons "ZScaleFactor" 1.0)
	      (cons "Rotation" 0.0)
	      ))
       
       (if (/=(get-item-by-name-in-list options "draw-elevation")"0")
	 (draw-text-vla-by-list-property
	   (list
	     (cons "spece" (if (eq (getvar "CTAB")"Model")model_spece paper_spece))
	     (cons "TextString" (rtos elevation 2 (atoi(get-item-by-name-in-list options "accuracy-elevation"))))
	     (cons "InsertionPoint"
		   (mapcar '+
			   (list (nth 0 t1) (nth 1 t1)
				 (if (/=(get-item-by-name-in-list options "3d-elevation")"0")
				   elevation 0.0))
			   (list (/ h-text 4.0) 0.0 0.0))
		   )
	     (cons "StyleName" style-text)
	     (cons "Height" h-text)
	     (cons "Rotation" 0)
	     (cons "Alignment" 9)
	     ))
	 )
       (vla-EndUndoMark active_document)
       )
      )
    )
  (princ)
  )

(defun dialog-insert-relief-point (options / dcl_id end-flag list-toggle result)
  ; диалоговое окно настроек вставки пикетов
  (defun mode_tile-flag (/)
    (setq list-toggle(list "3d-block" "3d-elevation" "accuracy-elevation"))
    (if (= (get_tile "draw-elevation") "0")
      (foreach x list-toggle
	(mode_tile x 1))
      (foreach x list-toggle
	(mode_tile x 0)
	)))
  (setq dcl_id (geo-tools-load-dialog "dialog_insert_relief_point"))
  (new_dialog "dialog_insert_relief_point" dcl_id)
  (foreach x options
    (set_tile (car x) (cadr x)))
  (mode_tile-flag)
  (action_tile "draw-elevation"(vl-prin1-to-string'(mode_tile-flag)))
  (action_tile "accept"
    (vl-prin1-to-string
      '(progn
	(foreach x options
	 (setq result(append result (list (list (car x)(get_tile (car x))))))
	 )
	(done_dialog 1)
	)))
    (setq end-flag(start_dialog))
  (unload_dialog dcl_id)
  (if (= 1 end-flag) result options)
  )