(defun draw-ramka-planshet (input-point list-dialog / n numbers scale side t1 t2 t3 t4 temp-list temp-list-x temp-list-y)
  ; программа отрисовки зарамочного оформления планшета
  (defun numbers-coor (number numbers /); количество символов в координате
    (if (eq numbers 0)
      (rtos number 2 0)
      (rtos(rem number(expt 10 (+ numbers 2))) 2 0)
      )
    )
  (defun draw-str-by-temp-list (temp-list scale t1 TextString /)
    
    (draw-text-vla-by-list-property
      (list
	(cons "spece" (if (eq (getvar "CTAB")"Model")model_spece paper_spece))
	(cons "TextString" TextString)
	(cons "InsertionPoint" (mapcar '+ t1 (list  (*(atof(nth 4 temp-list))scale)(*(atof(nth 3 temp-list))scale) 0)))
	(cons "Height" (*(atof(nth 2 temp-list))scale))
	(cons "Rotation" (-(convert-grad-rad(atof(nth 5 temp-list)))(/ pi 2.0)))
	(cons "StyleName" (nth 1 temp-list))
	(cons "Linetype" "Continuous")
	(cons "Alignment" (atoi(nth 6 temp-list)))
	))
    )
  (setq side 250.0)
  (setq scale 0.5)
  (setq numbers (atoi(get-item-by-name-in-list list-dialog "numbers-coor")))
  (setq t1 (analisis-insert-point-planset-left-down-point input-point side))
  (setq t2 (mapcar '+ t1 (list 0.0 side)))
  (setq t3 (mapcar '+ t1 (list side side)))
  (setq t4 (mapcar '+ t1 (list side 0.0)))

  (vla-StartUndoMark active_document)
  (terpri)
  (setvar "CMDECHO" 0)
  (setvar "NOMUTT" 1)
  (command "_insert" (get-item-by-name-in-list list-dialog "path") t1 (rtos(* 1.0 scale)2 3) (rtos(* 1.0 scale)2 3) "0")
  (command "_explode" (entlast))
  (if(tblobjname "block" (vl-filename-base (get-item-by-name-in-list list-dialog "path")))(command "_-purge" "Б" (vl-filename-base (get-item-by-name-in-list list-dialog "path")) "Н"))
  (setvar "NOMUTT" 0)
  (setvar "CMDECHO" 1)
  
  (setq n 1)
  (while (setq temp-list (get-item-by-name-in-list list-dialog (strcat "str" (itoa n)))); нанесение зарамочных строк текста
    (if (=(get-item-by-name-in-list list-dialog "analisis-nomenclature")"0")
      (draw-str-by-temp-list temp-list scale t1 (nth 0 temp-list))
      (cond
	((= n 2)
	 (draw-str-by-temp-list temp-list scale t1
	   (cond
	     ((= (get-item-by-name-in-list list-dialog "sk") "0")
	      (analisis-nomenclature-full-for-m500-sis-coor-oms t1))
	     ((= (get-item-by-name-in-list list-dialog "sk") "1")
	      (analisis-nomenclature-full-for-m500-sis-coor-63 t1))
	     ((= (get-item-by-name-in-list list-dialog "sk") "2")
	      (analisis-nomenclature-full-for-m500-msk-saratov t1))
	     )
	   )
	 )
	((= n 7)
	 (draw-str-by-temp-list temp-list scale t1
	   (cond
	     ((= (get-item-by-name-in-list list-dialog "sk") "0")
	      (analisis-nomenclature-full-for-m500-sis-coor-oms (mapcar '+ t1 (list 0 side))))
	     ((= (get-item-by-name-in-list list-dialog "sk") "1")
	      (analisis-nomenclature-full-for-m500-sis-coor-63 (mapcar '+ t1 (list 0 side))))
	     ((= (get-item-by-name-in-list list-dialog "sk") "2")
	      (analisis-nomenclature-full-for-m500-msk-saratov (mapcar '+ t1 (list 0 side))))
	     )
	   )
	 )
	((= n 8)
	 (draw-str-by-temp-list temp-list scale t1
	   (cond
	     ((= (get-item-by-name-in-list list-dialog "sk") "0")
	      (analisis-nomenclature-full-for-m500-sis-coor-oms (mapcar '- t1 (list side 0))))
	     ((= (get-item-by-name-in-list list-dialog "sk") "1")
	      (analisis-nomenclature-full-for-m500-sis-coor-63 (mapcar '- t1 (list side 0))))
	     ((= (get-item-by-name-in-list list-dialog "sk") "2")
	      (analisis-nomenclature-full-for-m500-msk-saratov (mapcar '- t1 (list side 0))))
	     )
	   )
	 )
	((= n 9)
	 (draw-str-by-temp-list temp-list scale t1
	   (cond
	     ((= (get-item-by-name-in-list list-dialog "sk") "0")
	      (analisis-nomenclature-full-for-m500-sis-coor-oms (mapcar '+ t1 (list side 0))))
	     ((= (get-item-by-name-in-list list-dialog "sk") "1")
	      (analisis-nomenclature-full-for-m500-sis-coor-63 (mapcar '+ t1 (list side 0))))
	     ((= (get-item-by-name-in-list list-dialog "sk") "2")
	      (analisis-nomenclature-full-for-m500-msk-saratov (mapcar '+ t1 (list side 0))))
	     )
	   )
	 )
	((= n 10)
	 (draw-str-by-temp-list temp-list scale t1
	   (cond
	     ((= (get-item-by-name-in-list list-dialog "sk") "0")
	      (analisis-nomenclature-full-for-m500-sis-coor-oms (mapcar '- t1 (list 0 side))))
	     ((= (get-item-by-name-in-list list-dialog "sk") "1")
	      (analisis-nomenclature-full-for-m500-sis-coor-63 (mapcar '- t1 (list 0 side))))
	     ((= (get-item-by-name-in-list list-dialog "sk") "2")
	      (analisis-nomenclature-full-for-m500-msk-saratov (mapcar '- t1 (list 0 side))))
	     )
	   )
	 )
	(T
	 (draw-str-by-temp-list temp-list scale t1 (nth 0 temp-list))
	 )
	)
      )
    (setq n (1+ n))
    )
  
  (setq n 1)
  (foreach x (list t1 t2 t3 t4); подпись координат углов планшета
    (setq temp-list-y (get-item-by-name-in-list list-dialog (strcat "y" (itoa n))))
    (draw-text-vla-by-list-property; y
      (list
	(cons "spece" (if (eq (getvar "CTAB")"Model")model_spece paper_spece))
	(cons "TextString" (numbers-coor(nth 0 x)numbers))
	(cons "InsertionPoint" (mapcar '+ x (list  (*(atof(nth 3 temp-list-y))scale)(*(atof(nth 4 temp-list-y))scale) 0)))
	(cons "Height" (*(atof(nth 2 temp-list-y))scale))
	(cons "Rotation" (-(convert-grad-rad(atof(nth 5 temp-list-y)))(/ pi 2.0)))
	(cons "StyleName" (nth 1 temp-list-y))
	(cons "Linetype" "Continuous")
	(cons "Alignment" (atoi(nth 6 temp-list-y)))
	))
    (setq temp-list-x (get-item-by-name-in-list list-dialog (strcat "x" (itoa n))))
    (draw-text-vla-by-list-property; x
      (list
	(cons "spece" (if (eq (getvar "CTAB")"Model")model_spece paper_spece))
	(cons "TextString" (numbers-coor(nth 1 x)numbers))
	(cons "InsertionPoint" (mapcar '+ x (list  (*(atof(nth 3 temp-list-x))scale)(*(atof(nth 4 temp-list-x))scale) 0)))
	(cons "Height" (*(atof(nth 2 temp-list-x))scale))
	(cons "Rotation" (-(convert-grad-rad(atof(nth 5 temp-list-x)))(/ pi 2.0)))
	(cons "StyleName" (nth 1 temp-list-x))
	(cons "Linetype" "Continuous")
	(cons "Alignment" (atoi(nth 6 temp-list-x)))
	))
    (setq n (1+ n))
    )
  
  (vla-EndUndoMark active_document)
  (princ)
  )