(defun C:format_all ( / patch file linetyp_str linetyp_str_list list_linetyp_name
		     mlinetyp_str mlinetyp_str_list list_mlinetyp_name list_str_linetyp_name list_str_mlinetyp_name x)
  
  (geo_tools-help "format_all")
  (load_global_variable)
  (setvar "CMDECHO" 0)
  (setvar "NOMUTT" 1)
  (mapcar '(lambda (x) (if (not (tblobjname "style" (car x)))
			 (entmake (list'(0 . "STYLE")'(100 . "AcDbSymbolTableRecord")'(100 . "AcDbTextStyleTableRecord")
				       (cons 2 (car x)) '(70 . 0) '(40 . 0.0) '(41 . 1.0) (cons 50 (caddr x)) '(71 . 0) '(42 . 2.5) (cons 3 (cadr x)) ))
			 (command "_style" (car x) (cadr x) "0" "1" (caddr x) "_n" "_n")
;;;			 (entmod (list(cons -1 (tblobjname "style" (car x)))'(0 . "STYLE")'(100 . "AcDbSymbolTableRecord")'(100 . "AcDbTextStyleTableRecord")
;;;				      (cons 2 (car x)) '(70 . 0) '(40 . 0.0) '(41 . 1.0) (cons 50 (caddr x)) '(71 . 0) '(42 . 2.5) (cons 3 (cadr x)) ))
			 ))
	  (list '("Топографический полужирный (Т-132)" "t132.ttf" 0)
		'("Древний курсив полужирный (Д-432)" "d432.ttf" 0)
		'("Рубленый (Р-131)" "p131.ttf" 0)
		'("Древний курсив остовный (До-431)" "do431.ttf" 0)
		'("БСАМ курсив малоконтрасный (Бм-431)" "BM431.ttf" 0)
		'("Древний курсив (Д-431)" "d431.ttf" 0)
		'("Рубленый широкий (Р-151)" "p151.ttf" 0)
		(list "ЕСКД (ГОСТ) наклонный" "ESKDU.shx" (* 13 (/ pi 180)))
		'("Arial" "arial.ttf" 0)
		'("Times New Roman" "times.ttf" 0)
		'("ЕСКД (ГОСТ)" "ESKDU.shx" 0))
	  )
  (setvar "NOMUTT" 0)
  (setvar "CMDECHO" 1)
  (setvar "LTSCALE" 1.0)
  (setvar "LUNITS" 2)
  (setvar "LUPREC" 3)
  (setvar "AUNITS" 1)
  (setvar "AUPREC" 4)
  (setvar "ANGDIR" 1)
  (setvar "INSUNITS" 6)
  (setvar "ANGBASE" (/ pi 2))
  (setq patch (strcat *geo_tools_root_dir* "\\data\\Линии.lin"))
  (setq file (open patch "r"))
  (setq linetyp_str (read-line file))
  (while linetyp_str
    (if (= (ascii linetyp_str) 42)
      (progn
	(setq linetyp_str_list (cdr(vl-string->list linetyp_str)))
	(while (/= (car linetyp_str_list) (ascii ","))
	  (setq list_linetyp_name(append list_linetyp_name (list (car linetyp_str_list))))
	  (setq linetyp_str_list(cdr linetyp_str_list))
	  )
	(setq list_str_linetyp_name(append list_str_linetyp_name (list (vl-list->string list_linetyp_name))))
	)
      )
    (setq list_linetyp_name nil)
    (setq linetyp_str (read-line file))
    )
  (close file)
  (repeat (length list_str_linetyp_name)
    (if (not (tblobjname "ltype" (car list_str_linetyp_name)))
      (vla-load (vla-get-Linetypes active_document) (car list_str_linetyp_name) "Линии.lin")
      )
    (setq list_str_linetyp_name (cdr list_str_linetyp_name))
    )
  (mapcar '(lambda (x) (if (not (tblobjname "layer" (car x)))
			 (entmake (list'(0 . "LAYER")'(100 . "AcDbSymbolTableRecord")'(100 . "AcDbLayerTableRecord")
				       (cons 2 (car x))'(70 . 0)(cons 62 (cadr x))'(6 . "Continuous")(cons 290 (caddr x))'(370 . -3)))
			 (entmod (list(cons -1 (tblobjname "layer" (car x)))'(0 . "LAYER")'(100 . "AcDbSymbolTableRecord")'(100 . "AcDbLayerTableRecord")
				      (cons 2 (car x))'(70 . 0)(cons 62 (cadr x))'(6 . "Continuous")(cons 290 (caddr x))'(370 . -3)))))
	  (list '("Вид экрана" 5 0)
		'("Вспомогательный" 6 0)
		'("Геология" 7 1)
		'("Горизонталь Вспомогательная" 30 1)
		'("Горизонталь Основная" 32 1)
		'("Лишние пикеты" 7 1)
		'("Пикеты" 7 1)
		'("Поверхность" 7 1)
		'("Сводка" 7 1)
		'("Сетка" 7 1)
		'("Ситуация" 7 1)
		'("Формат" 7 1)))
  (setq patch (strcat *geo_tools_root_dir* "\\data\\Мультилинии.mln"))
  (setq file (open patch "r"))
  (setq mlinetyp_str (read-line file))
  (while mlinetyp_str
    (if (= (ascii mlinetyp_str) 50)
      (progn
	(setq mlinetyp_str (read-line file))
	(setq mlinetyp_str_list (cdr(vl-string->list mlinetyp_str)))
	(repeat (length mlinetyp_str_list)
	  (setq list_mlinetyp_name(append list_mlinetyp_name (list (car mlinetyp_str_list))))
	  (setq mlinetyp_str_list(cdr mlinetyp_str_list))
	  )
	(setq list_str_mlinetyp_name(append list_str_mlinetyp_name (list (vl-list->string list_mlinetyp_name))))
	)
      )
    (setq list_mlinetyp_name nil)
    (setq mlinetyp_str (read-line file))
    )
  (close file)
  (repeat (length list_str_mlinetyp_name)
    (if (not (tblobjname "ltype" (car list_str_mlinetyp_name)))
      (load_mlinestyle "Мультилинии.mln" (car list_str_mlinetyp_name) nil)
      )
    (setq list_str_mlinetyp_name (cdr list_str_mlinetyp_name))
    )
  (princ)
  )
