

;;;begin  read-data-function "readfile(filename listname)"从工程文件中读出1、工程地质剖面 。2、单页柱状中所绘制的钻孔名称 。3、读出钻孔综合数据的函数
;;;begin  read-data-function "readfile(filename listname)"从工程文件中读出1、工程地质剖面 。2、单页柱状中所绘制的钻孔名称 。3、读出钻孔综合数据的函数
;;;begin  read-data-function "readfile(filename listname)"其中filename为工程所在位置，包括路径及工程文件名，
;;;begin  read-data-function "readfile(filename listname)"其中listname为要读出的数据表的标志字符串，如3、钻孔综合数据为"**zk1"等，zk1为钻孔编号，其结果得到单个钻孔的综合数据表如zk1、zk2等等
;;;begin  read-data-function "readfile(filename listname)"其中listname为要读出的数据表的标志字符串，如2、单页柱状中所绘制的钻孔为"**zzt"等，zzt表示柱状图，其结果得到一个表zzt，所包含的一系列子表为各张钻孔柱状图所包含的钻孔及左右顺序
;;;begin  read-data-function "readfile(filename listname)"其中listname为要读出的数据表的标志字符串，如1、工程地质剖面为"**pmt"等，pmt表示剖面图，其结果得到一个表，所包含的一系列子表为各单张剖面图所包含的钻孔编号、孔口标高、最大孔深、在剖面中的位置、水平比例及垂直比例
(defun readfile	(e g)
  (setq ff (open e "r"))
  (setq b ())
  (setq a t)
  (while (/= a "**end")			;while1
    (setq a (read-line ff))
    (if	(= a g)				;if1
      (while (/= a "**end")		;while2
	(setq a (read-line ff))
	(if (/= (substr a 1 2) "**")	;if2
	  (setq b (append b (list a)))
	  (setq a "**end")
	)				;if2
      )					;end while2
    )					;end while1
  )					;end if1
  (close ff)
  (setq c b)
)
;;;end  read-data-function "readfile(filename listname)"从工程文件中读出1、工程地质剖面 。2、单页柱状中所绘制的钻孔名称 。3、读出钻孔综合数据的函数
;;;end   read-data-function "readfile(filename listname)"其中filename为工程所在位置，包括路径及工程文件名，
;;;end   read-data-function "readfile(filename listname)"其中listname为要读出的数据表的标志字符串，如3、钻孔综合数据为"**zk1"等，zk1为钻孔编号，其结果得到单个钻孔的综合数据表如zk1、zk2等等
;;end   read-data-function "readfile(filename listname)"其中listname为要读出的数据表的标志字符串，如2、单页柱状中所绘制的钻孔为"**zzt"等，zzt表示柱状图，其结果得到一个表zzt，所包含的一系列子表为各张钻孔柱状图所包含的钻孔及左右顺序
;;end   read-data-function "readfile(filename listname)"其中listname为要读出的数据表的标志字符串，如1、工程地质剖面为"**pmt"等，pmt表示剖面图，其结果得到一个表，所包含的一系列子表为各单张剖面图所包含的钻孔编号、孔口标高、最大孔深、在剖面中的位置、水平比例及垂直比例


;;;begin  read-data-function "readfile1(filename)"
;;;begin  read-data-function "readfile1(filename)"
;;;begin  read-data-function "readfile1(filename)"
;;;begin  read-data-function "readfile1(filename)"
(defun readfile1 (g)
  (setq ff (open g "r"))
  (setq b ())
  (setq	a nil
	j 0
  )
  (while (< j 50)			;while1
    (setq a (read-line ff))
    (if	(/= a nil)			;if2
      (setq b (append b (list a))
	    j 0
      )
      (setq j (1+ j))
    )					;if2
  )					;end while1
  (close ff)
  (setq c b)
)					;end read-data-function "readfile1(filename)"
					;end read-data-function "readfile1(filename)"
					;end read-data-function "readfile1(filename)"

(setq gcwzb (apply 'readfile1 (list "c:/Gees2000/gcwz.txt")))
























(defun getbzyxb	(filename)
;;;;begin defun  getbzyxb(filename)    return after sorted bzyxb
;;;;begin defun  getbzyxb(filename)    return after sorted bzyxb
;;;;begin defun  getbzyxb(filename)    return after sorted bzyxb
;;;;begin defun  getbzyxb(filename)    return after sorted bzyxb

;;;subfunction1;;;;end defun  getbzyxb(filename)
;;;subfunction1 begin  read-data-function "readfile3(filename)"
;;;subfunction1 begin  read-data-function "readfile3(filename)"
;;;subfunction1 begin  read-data-function "readfile3(filename)"
  (defun readfile3 (filename)
    (setq ff (open filename "r"))
    (setq b ())
    (setq bzyxbbj nil)
    (setq a nil
	  j 0
	  bzyxbbj ""
    )
    (while (< j 50)			;while1
      (setq a (read-line ff))
      (setq p "")
      (if (/= a nil)
	(setq p a)
      )
      (if (= (substr p 1 2) "**")
	(setq bzyxbbj (substr a 3))
      )
      (if (and (/= a nil) (/= a "") (/= (substr a 1 2) "**")) ;if2
	(setq b	(append b (list a))
	      j	0
	)
	(setq j (1+ j))
      )					;if2
    )					;end while1
    (close ff)
    (setq c b)
  )					;end subfunction1 read-data-function "readfile3(filename)"
					;end subfunction1 read-data-function "readfile3(filename)"
					;end subfunction1 read-data-function "readfile3(filename)"
					;end subfunction1 read-data-function "readfile3(filename)"
					;end subfunction1 read-data-function "readfile(filename)"
					;end subfunction1 read-data-function "readfile(filename)"
					;end subfunction1 read-data-function "readfile(filename)"




;;; subfunction2 对字符串表如标准岩性名称表由多至少进行排序
;;; subfunction2 调用形式为：(setq bzyxb1 (apply 'pszhc (list bzyxb)))
;;; subfunction2 其中bzyxb为欲排序的字符串表，调用该函数后返回排序的的一个新表如bzyxb1
;;; subfunction2 局部变量分别为(a / b c d e f i g1 j1 g h)
  (defun pszhc (a)
    (setq g (length a))
    (setq c a)
    (setq b nil)
    (repeat g

      (setq g1 (length c))
      (repeat g1
	(setq j1 0)
	(setq f (nth 0 c))
	(while (< j1 (1- g1))
	  (setq j1 (1+ j1))
	  (if (< (strlen f) (strlen (nth j1 c)))
	    (setq f (nth j1 c))
	  )
	)				;end while (< j1 g1)
      )					;end repeat g1

      (setq b (append b (list f)))
      (setq i 0)
      (setq d ())
      (while (< i (length c))
	(if (/= (nth i c) f)
	  (setq d (append d (list (nth i c))))
	)				;endif
	(setq i (1+ i))
      )					;end while
      (setq c d)
    )
    (setq e b)
  )					;end defun
;;; subfunction2 排序pszhc定义结束
;;; subfunction2 排序pszhc定义结束
;;; subfunction2 排序pszhc定义结束
;;; subfunction2 排序pszhc定义结束
;;; subfunction2 排序pszhc定义结束



;;;;;; subfunction3 write bzyxb3 to "c:/Gees2000/标准岩土名称.txt"writeflie3(a b)function
;;;;;; subfunction3 write bzyxb3 to "c:/Gees2000/标准岩土名称.txt"writeflie3(a b)function
;;;;;; subfunction3 write bzyxb3 to "c:/Gees2000/标准岩土名称.txt"writeflie3(a b)function
;;;;;; subfunction3 write bzyxb3 to "c:/Gees2000/标准岩土名称.txt"writeflie3(a b)function
;;;;;; subfunction3 write bzyxb3 to "c:/Gees2000/标准岩土名称.txt"writeflie3(a b)function

  (defun writefile3 (a b)
    (setq ff (open b "w"))
    (setq i 0
	  s (strcat "\n" "**" (itoa (length a)))
    )
    (repeat (length a)
      (setq c (strcat "\n" (nth i a)))
      (setq i (1+ i))
      (princ c ff)
    )					;end repeat
    (princ s ff)
    (close ff)
  )
;;; subfunction3 end defun writefile3(a b)write bzyxb3 to "c:/Gees2000/标准岩土名称.txt"writeflie3(a b)function
;;; subfunction3 end defun writefile3(a b)write bzyxb3 to "c:/Gees2000/标准岩土名称.txt"writeflie3(a b)function


  (setq bzyxb3 (apply 'readfile3 (list filename)))
  (if (/= bzyxbbj (itoa (length bzyxb3)))
    (progn
      (setq bzyxb3 (apply 'pszhc (list bzyxb3)))
      (apply 'writefile3 (list bzyxb3 filename))
    )					;end progn
  )					;endif
  (setq a bzyxb3)
)
;;;;end defun  getbzyxb(filename)
;;;;end defun  getbzyxb(filename)
;;;;end defun  getbzyxb(filename)
;;;;end defun  getbzyxb(filename)








(defun zzttkfun	(zk)
;;;;;



  (setq zhb nil)
  (setq ksb nil)
  (setq yxmsb nil)
  (setq ztmdb nil)
  (setq hslb nil)
  (setq czlb nil)
  (setq mzlb nil)
  (setq yzyb nil)
  (setq ldyb nil)
  (setq bgb nil)
  (setq zeb nil)
  (setq fchb nil)
  (setq cyfhb nil)
  (setq yyb nil)
  (setq lsdtb nil)
  (setq dtblc nil)
  (setq i1 0)
  (if (= (nth i1 zk) "---0")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq zhb (append zhb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---0
  (if (= (nth i1 zk) "---1")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq ksb (append ksb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---1
  (if (= (nth i1 zk) "---2")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq yxmsb (append yxmsb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---2
  (if (= (nth i1 zk) "---3")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq fchb (append fchb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---2
  (if (= (nth i1 zk) "---4")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq cyfhb (append cyfhb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---2

  (if (= (nth i1 zk) "---5")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq ztmdb (append ztmdb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---3
  (if (= (nth i1 zk) "---6")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq hslb (append hslb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---4
  (if (= (nth i1 zk) "---7")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq czlb (append czlb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---5
  (if (= (nth i1 zk) "---8")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq mzlb (append mzlb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---6
  (if (= (nth i1 zk) "---9")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq yzyb (append yzyb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---7
  (if (= (nth i1 zk) "---10")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq ldyb (append ldyb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---8
  (if (= (nth i1 zk) "---11")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq bgb (append bgb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---9
  (if (= (nth i1 zk) "---12")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq zeb (append zeb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---10



  (if (= (nth i1 zk) "---13")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq yyb (append yyb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---10


  (if (= (nth i1 zk) "---14")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq lsdtb (append lsdtb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---10



  (if (= (nth i1 zk) "---15")
    (progn				;progn0
      (setq i1 (1+ i1))
      (setq dtblc (nth i1 zk))
    )					;end while0
  )					;end progn0
					;end if---10


  (command "_.style" "style1" "楷体_GB2312" "" "" "" "" "" "")
  (command "_.style" "style11" "@楷体_GB2312" 0.23 "" "" "" "" "y")
  (command "_.style" "style2" "宋体" 0.23 "" "" "" "" "")
  (command "_.pline" "0.05,0" "w" 0.07 "" "16.95,0" "16.95,26" "0.05,26"
	   "c")
  (command "_.pline" "0.05,0.7" "w" 0.013 "" "16.95,0.7" "")
  (command "_.pline" "3.15,0" "w" 0.013 "" "3.15,0.7" "")
  (command "_.text" "s" "style1" "m" "1.65,0.35" 0.23 0 "")
  (command "_.pline" "4.15,0" "w" 0.013 "" "4.15,0.7" "")
  (command "_.text" "s"	"style1" "m" "3.65,0.35" 0.23 0	"编 制")
  (setq txt1 (nth 2 gcgkb))
  (command "_.text" "s"	"style1" "m" "1.5,0.35" 0.23 0	txt1)
  (command "_.pline" "5.95,0" "w" 0.013 "" "5.95,0.7" "")
  (command "_.text" "s"	"style1" "m" "6.45,0.35" 0.23 0	"复 核")
  (command "_.pline" "6.95,0" "w" 0.013 "" "6.95,0.7" "")
  (command "_.pline" "8.75,0" "w" 0.013 "" "8.75,0.7" "")
  (command "_.text" "s"	"style1" "m" "9.25,0.35" 0.23 0	"审 核")
  (command "_.pline" "9.75,0" "w" 0.013 "" "9.75,0.7" "")
  (command "_.pline" "11.55,0" "w" 0.013 "" "11.55,0.7" "")
  (command "_.text" "s"	"style1" "m" "12.05,0.35" 0.23 0 "图表号")
  (setq txt1 (nth 15 gcgkb))
  (command "_.text" "s" "style1" "m" "13.45,0.35" 0.23 0 txt1)

  (command "_.pline" "12.55,0" "w" 0.013 "" "12.55,0.7" "")
  (command "_.pline" "14.35,0" "w" 0.013 "" "14.35,0.7" "")
  (setq slzym (nth 5 gcgkb))
  (setq slqsym (atoi (nth 6 gcgkb)))
  (if (> (atoi slzym) zym)
    (setq zym (atoi slzym))
  )
  (setq	tkym (strcat "第"
		     (itoa (+ slqsym zzth))
		     "页"
		     " "
		     "共"
		     (itoa zym)
		     "页"
	     )
  )
  (command "_.text" "s" "style1" "m" "15.75,0.35" 0.23 0 tkym)
  (setq tjymh tkym)


;;;;;;
  (command "_.rectang" "w" 0.03 "0.3,1" "16.7,23.5")
  (command "_.pline" "0.3,22" "w" 0.03 "" "16.7,22" "")
  (command "_.pline" "1.8,1" "w" 0.013 "" "1.8,23.5" "")
  (command "_.text" "s"	"style1" "m" "0.7,23.1" 0.23 0 "分层")
  (command "_.text" "s"	"style1" "m" "0.7,22.6" 0.23 0 "孔深")
  (command "_.text" "s" "style1" "m" "0.7,22.3" 0.23 0 "(m)")
  (command "_.pline" "1.1,1" "w" 0.013 "" "1.1,23.5" "")
  (command "_.text" "s" "style1" "m" "2.3,23" 0.23 0 "层 厚")
  (command "_.text" "s" "style1" "m" "2.3,22.5" 0.23 0 "(m)")
  (command "_.pline" "4.3,1" "w" 0.013 "" "4.3,23.5" "")
  (command "_.text" "s"	"style1" "m" "3.55,23" 0.23 0 "层底标高")
    (command "_.text" "s" "style1" "m" "3.55,22.5" 0.23 0 "(m)")
(command "_.pline" "5.65,1" "w" 0.013 "" "5.65,23.5" "")
  (command "_.text" "s"	"style1" "m" "4.975,23.1" 0.23 0 "柱 状 图")
  (command "_.text" "s"	"style1" "m" "4.975,22.6" 0.2 0	"比例")
  (command "_.text" "s" "style1" "mr" "4.9,22.3" 0.2 0 "1:")
  (setq txt1 (nth 11 zhb))
  (command "_.text" "s" "style1" "ml" "5,22.3" 0.2 0 txt1)
  (command "_.pline" "0.03,25" "w" 0.03 "" "16.9,25" "")
  (setq tm (nth 0 gcgkb))
  (command "_.text" "s" "style1" "m" "8.45,25.5" 0.4 0 tm)
  (command "_.text" "s"	"style1" "mr" "1.9,24.55" 0.23 0	"钻孔编号：")
  (setq txt1 (nth 1 zhb))
  (command "_.text" "s" "style1" "ml" "1.9,24.55" 0.23 0 txt1)
  (command "_.text" "s"	"style1" "mr" "1.9,23.9" 0.23 0 "钻孔坐标：")
  (setq txt1 (nth 2 zhb))
  (setq txt2 (nth 3 zhb))
  (setq txt3 (strcat "x=" txt1 "  y=" txt2))
  (if(and (/= txt1 "")(/= txt2 ""))
  (command "_.text" "s" "style1" "ml" "1.9,23.9" 0.23 0 txt3)
    )
  (setq txt1 "")
  (if (and (/= (nth 6 zhb) "")
	  (/= (nth 6 zhb) " ")
	  (/= (nth 6 zhb) "  ")
	  (/= (nth 6 zhb) "   ")
      )
    (setq txt1 (strcat (nth 5 zhb) "、" (nth 6 zhb)))
  )
  (if (and (/= (nth 7 zhb) "")
	  (/= (nth 7 zhb) " ")
	  (/= (nth 7 zhb) "  ")
	  (/= (nth 7 zhb) "   ")
      )
    (setq txt1 (strcat txt1 "、" (nth 7 zhb)))
  )
  (command "_.text" "s"	"style1" "mr" "8.1,24.55" 0.23 0	"孔口高程：")
  (setq txt1 (nth 4 zhb))
  (command "_.text" "s" "style1" "ml" "8.1,24.55" 0.23 0 txt1)
  (command "_.text" "s"	"style1" "mr" "8.1,23.9" 0.23 0 "水位埋深：")
  (setq txt1 (nth 12 zhb))
  (command "_.text" "s" "style1" "ml" "8.1,23.9" 0.23 0 txt1)
  (command "_.text" "s"	"style1" "mr" "13.5,23.9" 0.23 0 "终孔日期：")
  (setq txt1 "")
  (if (and (/= (nth 9 zhb) "")
	   (/= (nth 9 zhb) " ")
	   (/= (nth 9 zhb) "  ")
	   (/= (nth 9 zhb) "   ")
      )
    (if	(and (/= (nth 8 zhb) "")
	     (/= (nth 8 zhb) " ")
	     (/= (nth 8 zhb) "  ")
	     (/= (nth 8 zhb) "   ")
	)
      (setq txt1 (strcat (nth 8 zhb) "、" (nth 9 zhb)))
      (setq txt (nth 9 zhb))
    )
  )
  (if (and (/= (nth 10 zhb) "")
	   (/= (nth 10 zhb) " ")
	   (/= (nth 10 zhb) "  ")
	   (/= (nth 10 zhb) "   ")
      )
    (setq txt1 (strcat txt1 "、" (nth 10 zhb)))
  )
  (command "_.text" "s" "style1" "ml" "13.5,23.90" 0.23 0 txt1)
  (command "_.text"	"s"	     "style1"	  "mr"
	   "13.5,24.55"	0.23	     0		  "开孔日期："
	  )
  (setq txt1 "")
  (if (and (/= (nth 6 zhb) "")
	   (/= (nth 6 zhb) " ")
	   (/= (nth 6 zhb) "  ")
	   (/= (nth 6 zhb) "   ")
      )
    (setq txt1 (strcat (nth 5 zhb) "、" (nth 6 zhb)))
  )
  (if (and (/= (nth 10 zhb) "")
	   (/= (nth 10 zhb) " ")
	   (/= (nth 10 zhb) "  ")
	   (/= (nth 10 zhb) "   ")
      )
    (setq txt1 (strcat txt1 "、" (nth 10 zhb)))
  )
  (command "_.text" "s" "style1" "ml" "13.5,24.55" 0.23 0 txt1)



  (setq dt1 (atof (nth 4 zhb)))
  (setq dt2 0)
  (setq dt (/ (atof (nth 11 zhb)) 100))

  (if (/= lsdtb nil)
    (progn
      (setq dtbl (nth 2 lsdtb))
      (if (/= dtbl "自动")
	(setq dtbl (atof dtbl))
      )
    )
;;;endprogn
  )
;;;endif 

  (setq dtbl (atof dtblc))


  (if (<= dtbl 0)

    (progn
      (setq js nil)


      (setq i  0
	    ch (/ (length bgb) 5)
      )
      (repeat ch			;repeat 00000000000000000000000000000
	(setq a (nth i bgb))
	(if (= (nth 28 gcwzb) "1")
	  (setq a (nth (+ i 4) bgb))
	)
	(setq js (append js (list (atof a))))
	(setq i (+ i 5))
      )
;;;;end repeat


      (setq i  0
	    ch (/ (length zeb) 5)
      )
      (repeat ch			;repeat 00000000000000000000000000000
	(setq a (nth i zeb))
	(if (= (nth 28 gcwzb) "1")
	  (setq a (nth (+ i 4) zeb))
	)
	(setq j	   1
	      k	   1
	      zejs nil
	)
	(while (>= (- (strlen a) j) 0)
	  (setq js1 (substr a j 2))
	  (setq js2 (substr a j 1))
	  (if (= js1 "，")
	    (setq zejs (append zejs (list (substr a k (- j k))))
		  k    (+ j 2)
	    )
	  )
	  (if (= js2 ",")
	    (setq zejs (append zejs (list (substr a k (- j k))))
		  k    (+ j 1)
	    )
	  )
	  (setq j (1+ j))
	)
	;;endwhilen
	(setq zejs (append zejs (list (substr a k (- j k)))))
	(setq n 0)
	(repeat	(length zejs)
	  (setq js (append js (list (atof (nth n zejs)))))
	  (setq n (1+ n))
	)
	;;endrepeat
	(setq i (+ i 5))
      )
;;;;end repeat

      (setq i 0)
      (while (<= i (1- (length lsdtb)))
	(progn
	  (if (= (nth i lsdtb) "连续动力触探类型：")
	    (setq i (+ i 5))
	  )
;;;endif
	  (setq js (append js (list (atof (nth i lsdtb)))))
	  (setq i (1+ i))
	)
      )
;;;end if
      (setq i 0
	    jsmax 0
      )
      (repeat (length js)
	(if (< jsmax (nth i js))
	  (setq jsmax (nth i js))
	)
	(setq i (1+ i))
      )
      (if (> (- (/ jsmax 11) (fix (/ jsmax 11))) 0.5)
	(setq a 1)
	(setq a 0.5)
      )
      (if (and (= (/ jsmax 11) (fix (/ jsmax 11)))
	       (> (fix (/ jsmax 11)) 0)
	  )
	(setq a 0)
      )
      (setq dtbl (+ a (fix (/ jsmax 11))))

    )
;;;endprogn
  )
;;;end if

  (setq	x 6.65
	i 1
  )
  (repeat 10
    (setq p1 (list x 22.4))
    (setq x (1+ x))
    (setq txt1 (rtos (* dtbl i) 2 1))
    (setq i (1+ i))
    (command "_.text" "s" "style1" "m" p1 0.2 0 txt1)
  )

  (setq x (+ 0.03 x))
  (setq p1 (list x 22.4))
  (setq txt1 (itoa (fix (+ (atof txt1) (/ dtbl 2)))))
  (setq txt1 (strcat ">" txt1))
  (command "_.text" "s" "style1" "mr" p1 0.2 0 txt1)

  (setq x 6.65)
  (repeat 10
    (setq p1 (list x 22))
    (setq p2 (list x 22.2))
    (setq x (1+ x))
    (command "_.pline" p1 "w" 0.016 "" p2 "")
  )



  (if (/= lsdtb nil)
    (setq txt1 (strcat (nth 1 lsdtb) "(击)"))
    (setq txt1 "N63.5(击)")
  )
  (command "_.text" "s" "style1" "m" "10.73,23" 0.33 0 txt1)



  (if (/= bgb nil)
    (progn
      (setq i 0)
      (while (< i (- (length bgb) 3))
	(setq txt1 "")
	(if (= (nth 27 gcwzb) "1")
	  (setq a (nth (+ i 4) bgb))
	  (setq a (nth i bgb))
	)
	(setq j 1)
	(while (>= (- (strlen a) j) 3)
	  (setq ft (substr a j 4))
	  (if (= ft "反弹")
	    (setq txt1 "反弹")
	  )
	  (setq j (1+ j))
	)
	;;endwhilen
	(setq b (- 22 (/ (atof (nth (1+ i) bgb)) dt)))
	(setq c (- 22 (/ (atof (nth (+ i 2) bgb)) dt)))
	(setq a (/ (atof a) dtbl))
	(setq p1 (list 5.65 b))
	(setq p2 (list (+ 5.65 a) b))
	(setq p3 (list (+ 5.65 a) c))
	(setq p4 (list 5.65 c))
	(command "_.line" p1 p2 p3 p4 "")
	(if (= txt1 "反弹")
	  (progn
	    (setq p5 (list 16.1 c))
	    (command "_.line" p5 p4 "")
	    (command "_.text" "s" "style1" "ml" p5 0.23 0 "反弹")
	    (setq txt1 "")
	  )
	  ;;endprogn
	)
;;;endif
	(setq i (+ i 5))
      )
;;;endwhile
    )
;;;;endprognbg
  )
;;;;endifbg





  (if (/= zeb nil)
    (progn
      (setq i 0)
      (command "_.color" 240)
      (while (< i (- (length zeb) 3))
	(setq txt1 "")
	(if (= (nth 28 gcwzb) "1")
	  (setq a (nth (+ i 4) zeb))
	  (setq a (nth i zeb))
	)

	(setq j	   1
	      k	   1
	      zejs nil
	)
	(while (>= (- (strlen a) j) 0)
	  (setq js1 (substr a j 2))
	  (setq js2 (substr a j 1))
	  (if (= js1 "，")
	    (setq zejs (append zejs (list (substr a k (- j k))))
		  k    (+ j 2)
	    )
	  )
	  (if (= js2 ",")
	    (setq zejs (append zejs (list (substr a k (- j k))))
		  k    (+ j 1)
	    )
	  )
	  (setq j (1+ j))
	)
	;;endwhilen
	(setq zejs (append zejs (list (substr a k (- j k)))))


	(setq b (- 22 (/ (atof (nth (1+ i) zeb)) dt)))
	(setq c (- 22 (/ (atof (nth (+ i 2) zeb)) dt)))
	(setq p1 (list 5.65 b))
	(command "_.line" p1)

	(setq k 0)
	(repeat	(length zejs)
	  (setq a (nth k zejs))
	  (setq j 1)
	  (while (>= (- (strlen a) j) 3)
	    (setq ft (substr a j 4))
	    (if	(= ft "反弹")
	      (setq txt1 "反弹")
	    )
	    (setq j (1+ j))
	  )
	  ;;endwhilen
	  (setq a (/ (atof a) dtbl))
	  (setq p2 (list (+ 5.65 a) b))
	  (setq b (- b (/ 0.1 dt)))
	  (if (= txt1 "反弹")
	    (progn
	      (setq p3 (list 16.1 (+ b (/ 0.1 dt))))
	      (command p3)
	      (setq p5 (list 5.65 (cadr p3)))
	      (command p5 "")
	      (command "_.color" "bylayer")
	      (command "_.text" "s" "style1" "ml" p3 0.23 0 "反弹")
	      (setq txt1 "")
	      (command "_.color" 240)
	    )
	    ;;endprogn
	    (progn
	      (setq p3 (list (+ 5.65 a) b))
	      (command p2 p3)
	    )
;;;endprogn	      
	  )
;;;endif
	  (setq k (1+ k))
	)
;;;endrepeat
	(setq p5 (list 5.65 b))
	(command p3 p5 "")
	(setq i (+ i 5))
      )
;;;endwhile
    )
;;;;endprognbg
  )
  (command "_.color" "bylayer")

;;;;;;end ifze



  (if (/= lsdtb nil)
    (progn
      (command "_.color" "blue")
      (setq i 0)
      (while (< i (length lsdtb))
	(if (= (nth i lsdtb) "连续动力触探类型：")
	  (setq	y  (- 22 (/ (atof (nth (+ i 4) lsdtb)) dt))
		dy (/ (atof (nth (+ i 3) lsdtb)) dt 100)
		i  (+ i 5)
	  )
	)
	(command "_.line" (list 5.65 y))
	(while (and (< i (length lsdtb))
		    (/= (nth i lsdtb) "连续动力触探类型：")
	       )
	  (setq	a    (nth i lsdtb)
		txt1 ""
	  )
	  (setq j 1)
	  (while (>= (- (strlen a) j) 3)
	    (setq ft (substr a j 4))
	    (if	(= ft "反弹")
	      (setq txt1 "反弹")
	    )
	    (setq j (1+ j))
	  )

	  (setq x (+ 5.65 (/ (atof (nth i lsdtb)) dtbl)))
	  (setq xx x)
	  (if (> xx 16.65)
	    (setq x 16.15)
	  )
	  (setq p1 (list x y))
	  (command p1)
	  (if (= txt1 "反弹")
	    (progn
	      (setq p3 (list 16.15 y))
	      (command p3)
	      (setq p1 (list 5.65 y))
	      (command p1 "")
	      (command "_.color" "bylayer")
	      (command "_.text" "s" "style1" "ml" p3 0.23 0 "反弹")
	      (setq txt1 "")
	      (command "_.color" "blue")
	    )
	    ;;endprogn
	    (progn
	      (if (<= xx 16.65)
		(progn
		  (setq y (- y dy))
		  (setq p1 (list x y))
		  (command p1)
		)
;;;endprogn
		(progn
		  (command "")
		  (setq p3 (list 16.65 (- y (/ dy 2))))
		  (command "_.color" "bylayer")
		  (command "_.text"
			   "s"
			   "style1"
			   "mr"
			   p3
			   0.23
			   0
			   (rtos (atof (nth i lsdtb)) 2 1)
		  )
		  (command "_.color" "blue")
		  (setq y (- y dy))
		  (setq p1 (list x y))
		  (command "_.line" p1)
		)
;;;endprogn
	      )
;;;end if
	    )
;;;endprogn
	  )
;;;endif	
	  (setq i (1+ i))
	)
;;;end whilen
	(setq p1 (list 5.65 y))
	(command p1 "")
      )
;;;endwhilew
    )
;;;endprogn
  )
;;;endif

  (command "_.color" "bylayer")
  (setq dtpd '(" "))
  (setq i 16)
  (setq jl t)
  (while (< i (length gcgkb))
    (if	(or (/= (nth i gcgkb) "")
	    (/= (nth i gcgkb) " ")
	    (/= (nth i gcgkb) "  ")
	    (/= (nth i gcgkb) "   ")
	    (/= (nth i gcgkb) "    ")
	)
      (if jl
	(setq dtpd (append dtpd (list (nth i gcgkb)))
	      jl   nil
	)
	(setq jl nil)
      )
    )
    (setq i (1+ i))
  )
;;;;endrepeat
  (if (< (length dtpd) 2)
    (setq dtpd '(" "	 "不合格"	 "合格"	 "良好"	 "优"
		 "优"	 "优"	 "优"	 "优"	 "优"	 "优"
		 "优"
		)
    )
  )
  (if (< (length dtpd) 2)
    (setq dtpd (append dtpd
		       (list ""	"" "" "" "" "" "" "" ""	"" "" "" "" ""
			     ""	"" "" "")
	       )
    )
  )
;;;endif
  (if (/= lsdtb nil)
    (progn
      (setq i 0)
      (while (< i (length lsdtb))
	(if (= (nth i lsdtb) "连续动力触探类型：")
	  (setq	dy    (/ (atof (nth (+ i 3) lsdtb)) dt 100)
		y     (- (- 22 (/ (atof (nth (+ i 4) lsdtb)) dt)) (/ dy 2))
		dtks  (atof (nth (+ i 4) lsdtb))
		dtgrl (/ (atof (nth (+ i 3) lsdtb)) 100)
		i     (+ i 5)
	  )
	)
	(setq p11 (list 0.3 (+ y (/ dy 2))))
	(setq p12 (list 4.3 (+ y (/ dy 2))))
	(command "_.line" p11 p12 "")
	(setq p11 (list 0.3 (- y (/ dy 2))))
	(setq p12 (list 4.3 (- y (/ dy 2))))

	
	(while (and (< i (length lsdtb))
		    (/= (nth i lsdtb) "连续动力触探类型：")
	       )
	  (setq a (rtos (atof (nth i lsdtb)) 2 1))
	  (setq p1 (list 2.3 y))
	  (setq
	    a (strcat (rtos dtks 2 2) "-" (rtos (+ dtks dtgrl) 2 2))
	  )
	  (setq p1 (list 1.05 y))
	  (setq	j  1
		yy t
	  )
	  (while (and yy (<= j (strlen (nth i lsdtb))))
	    (setq b (substr (nth i lsdtb) j 1))
	    (if	(= b "+")
	      (setq yy nil)
	    )
	    (setq j (1+ j))
	  )
;;;end while

	  (if (<= j (strlen (nth i lsdtb)))
	    (setq b (substr (nth i lsdtb) j 1)
		  c (substr (nth i lsdtb)
			    j
			    (- (strlen (nth i lsdtb)) j -1)
		    )
	    )
	    (setq b "2")
	  )
;;;endif
	  (if (> (atoi b) 0)
	    (setq a (nth (atoi b) dtpd))
	    (setq a c)
	  )
	  
	  (if (<= (*(- 22 y)dt) 5)
	  (if (>= (atof (nth i lsdtb)) 10)
	    (setq a "  ")
	    (setq a "  ")
	  )
	  (if (>= (atof (nth i lsdtb)) 10)
	    (setq a " ")
	    (setq a " ")
	  )
	    );;;;end if
	    
	  (setq p1 (list 3.55 y))
	  (command "_.text" "s" "style1" "m" p1 0.1 0 a)
	  (setq p11 (list 0.3 (- y (/ dy 2))))
	  (setq p12 (list 4.3 (- y (/ dy 2))))
	  (command "_.line" p11 p12 "")
	  (setq dtks (+ dtks dtgrl))
	  (setq y (- y dy))
	  (setq j (1+ j))
;;;endif	
	  (setq i (1+ i))
	)
;;;end whilen
      )
;;;endwhilew
    )
;;;endprogn
  )




  (setq plotstyle "zztA4")
)					;end defun zzttkfun















;;;;;;绘制左侧柱状图函数zzt1fun(zk)
;;;;;绘制左侧柱状图函数zzt1fun(zk)
;;;;;其中 zk为柱状图数据表
;;;;;其中 zk为柱状图数据表
;;;;;其中 zk为柱状图数据表
(defun zzt1fun (zk bzyxb)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;***********************************************************************************************
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;***********************************************************************************************

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;***********************************************************************************************

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;***********************************************************************************************

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;***********************************************************************************************





;;;;;;;从岩性描述中查找对应的岩性花纹函数qdyx(a b)
;;;;;;; 其中a为已定义好的标准岩性名称表；b为岩性描述字符串
;;;;;;;该函数返回确定后的岩性名称
;;;;;;;函数的调用方法：  (setq yx (apply 'qdyx (list bzyxb1 yxms)))
;;;;;;;yx为返回的岩性名称字符串变量,若表a中无相应名称的岩性则函数返回""
  (defun qdyx (a b)
    (setq i 0
	  j t
    )
    (while (and (< i (length a)) j)
      (setq c (nth i a))
      (setq l1 (strlen c))
      (setq i1 0)
      (while (and (< i1 38) j)
	(setq i1 (1+ i1))
	(if (/= (substr b i1 1) nil)
	  (if (or (= (substr b i1 2) "：") (= (substr b i1 1) ":"))
	    (setq i1 10000)
	  )
	)				;endif
	(setq d (substr b i1 l1))
	(if (= c d)
	  (setq j nil)
	)
      )					;end while(and (< i1 16)j)
      (setq i (1+ i))
    )					;end while(and (< i (length bzyxb1))j)
    (if	j
      (setq e "")
      (setq e c)
    )
  )
;;;;;;;end defun确定岩性名称函数qdyx(a b)
;;;;;;;end defun确定岩性名称函数qdyx(a b)
;;;;;;;end defun确定岩性名称函数qdyx(a b)
;;;;;;;end defun确定岩性名称函数qdyx(a b);
;;;;;;;end defun确定岩性名称函数qdyx(a b)
;;;;;;;end defun确定岩性名称函数qdyx(a b)
;;;;;;;end defun确定岩性名称函数qdyx(a b)
;;;;;;;end defun确定岩性名称函数qdyx(a b)
;;;;;;;end defun确定岩性名称函数qdyx(a b)
;;;;;;;end defun确定岩性名称函数qdyx(a b)
;;;;;;;end defun确定岩性名称函数qdyx(a b)
;;;;;;;end defun确定岩性名称函数qdyx(a b)
;;;;;;;end defun确定岩性名称函数qdyx(a b)
;;;;;;;end defun确定岩性名称函数qdyx(a b)
;;;;;;;从岩性描述中查找对应的岩性花纹函数qdyx(a b)
;;;;;;; 其中a为已定义好的标准岩性名称表；b为岩性描述字符串
;;;;;;;该函数返回确定后的岩性名称
;;;;;;;函数的调用方法：  (setq yx (apply 'qdyx (list bzyxb1 yxms)))
;;;;;;;yx为返回的岩性名称字符串变量,若表a中无相应名称的岩性则函数返回""
  (defun qdyxm (a b)
    (setq i 0
	  j t
    )
    (while (and (< i (length a)) j)
      (setq c (nth i a))
      (setq l1 (strlen c))
      (setq i1 0)
      (while (and (< i1 28) j)
	(setq i1 (1+ i1))
	(if (/= (substr b i1 1) nil)
	  (if (or (= (substr b i1 2) "：") (= (substr b i1 1) ":"))
	    (setq i1 50)
	  )
	)				;endif
	(setq d (substr b i1 l1))
	(if (and (= c d)
		 (/= c "全风化")
		 (/= c "强风化")
		 (/= c "中风化")
		 (/= c "弱风化")
		 (/= c "微风化")
	    )
	  (setq j nil)
	)
      )					;end while(and (< i1 16)j)
      (setq i (1+ i))
    )					;end while(and (< i (length bzyxb1))j)
    (if	j
      (setq e "")
      (setq e c)
    )
  )







  (defun huawentc (bzyxb3 yxms ks1 ks2)	;defunhuawentc (bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000
					;defunhuawentc (bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000
					;defunhuawentc (bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000
					;defunhuawentc (bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000
					;defunhuawentc (bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000
					;defunhuawentc (bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000
					;defunhuawentc (bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000
					;defunhuawentc (bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000
					;defunhuawentc (bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000
					;defunhuawentc (bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000
					;defunhuawentc (bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000
    (setq bzyxb1 '("全风化"    "强风化"	   "中风化"    "弱风化"
		   "微风化"    "粗砂"	   "中砂"      "细砂"
		   "粉砂"      "根植土"	   "种植土"    "圆砾"
		   "砾砂"
		  )
    )
    (command "_.style" "style1" "楷体_GB2312" "" "" "" "" "" "")
    (command "_.style" "style11" "@楷体_GB2312"	0.23 ""	"" "" "" "y")
    (command "_.style" "style2" "宋体" 0.23 "" "" "" "" "")
    (setq yx nil)
    (setq yx (apply 'qdyx (list bzyxb1 yxms)))
    (cond
      ((or (= yx "全风化")
	   (= yx "强风化")
	   (= yx "中风化")
	   (= yx "弱风化")
	   (= yx "微风化")
       )
       (progn				;progn1
	 (setq fileyx (strcat "c:/Gees2000/岩土花纹/" yx))
	 (setq fileyx1 (strcat "c:/Gees2000/岩土花纹/" yx ".dwg"))
	 (if (findfile fileyx1)		;if1111111111111111111111111
	   (progn			;progn111111111111
	     (if (<= ks2 21)		;if101 101 101 101
	       (if (< (/ (- ks2 ks1) 1.3) 1.5) ;if1
		 (progn	;;progn1
			(setq m (- ks2 ks1))
			(setq p1 (list 4.975 (- 22 ks1 (/ m 2)))
			      p2 (list 5.85 (- 22 ks1 (/ m 2)))
			)
			(command "_.minsert" fileyx p1 1 1 "" 1 1)

		 )			;endprogn1
		 (progn			;progn2
		   (setq n (fix (/ (- ks2 ks1) 1.3)))
		   (if (= n 1)
		     (setq n 2)
		   )
		   (setq m (/ (- ks2 ks1) n))
		   (setq p1 (list 4.975 (- 22 ks1 (/ m 2)))
			 p2 (list 5.85 (- 22 ks1 (/ m 2)))
		   )
		   (setq m1 (- 0 m))
		   (command "_.minsert" fileyx p1 1 1 "" n 1 m1)

		 )			;endprogn2
	       )			;end if1
	     )				;end if101 101 101 101 101
	     (if (>= ks1 21)		;if102 102 102 102 102 102
	       (if (< (/ (- ks2 ks1) 1.3) 1.5) ;if1
		 (progn	;;progn1
			(setq m (- ks2 ks1))
			(setq p1 (list 23.15 (- 43 ks1 (/ m 2)))
			      p2 (list 24.25 (- 43 ks1 (/ m 2)))
			)
			(command "_.minsert" fileyx p1 1 1 "" 1 1)
			(command "_.minsert" fileyx p2 1 1 "" 1 1)
		 )			;endprogn1
		 (progn			;progn2
		   (setq n (fix (/ (- ks2 ks1) 1.3)))
		   (if (= n 1)
		     (setq n 2)
		   )
		   (setq m (/ (- ks2 ks1) n))
		   (setq p1 (list 23.15 (- 43 ks1 (/ m 2)))
			 p2 (list 24.25 (- 43 ks1 (/ m 2)))
		   )
		   (setq m1 (- 0 m))
		   (command "_.minsert" fileyx p1 1 1 "" n 1 m1)
		   (command "_.minsert" fileyx p2 1 1 "" n 1 m1)
		 )			;endprogn2
	       )			;end if1
	     )				;end if102  102 102 102 102
	     (if (and (< ks1 21) (> ks2 21)) ;if103 103 103 103)
	       (progn			;progn103 103 103 103
		 (if (< (/ (- 21 ks1) 1.3) 1.5) ;if1
		   (progn ;;progn1
			  (setq m (- 21 ks1))
			  (setq	p1 (list 49.75 (- 22 ks1 (/ m 2)))
				p2 (list 5.85 (- 22 ks1 (/ m 2)))
			  )
			  (command "_.minsert" fileyx p1 1 1 "" 1 1)

		   )			;endprogn1
		   (progn		;progn2
		     (setq n (fix (/ (- 21 ks1) 1.3)))
		     (if (= n 1)
		       (setq n 2)
		     )
		     (setq m (/ (- 21 ks1) n))
		     (setq p1 (list 49.75 (- 22 ks1 (/ m 2)))
			   p2 (list 5.85 (- 22 ks1 (/ m 2)))
		     )
		     (setq m1 (- 0 m))
		     (command "_.minsert" fileyx p1 1 1 "" n 1 m1)

		   )			;endprogn2
		 )			;end if1
		 (if (< (/ (- ks2 21) 1.3) 1.5) ;if2
		   (progn ;;progn1
			  (setq m (- ks2 21))
			  (setq	p1 (list 23.15 (- 22 (/ m 2)))
				p2 (list 24.25 (- 22 (/ m 2)))
			  )
			  (command "_.minsert" fileyx p1 1 1 "" 1 1)
			  (command "_.minsert" fileyx p2 1 1 "" 1 1)
		   )			;endprogn1
		   (progn		;progn2
		     (setq n (fix (/ (- ks2 21) 1.3)))
		     (if (= n 1)
		       (setq n 2)
		     )
		     (setq m (/ (- ks2 21) n))
		     (setq p1 (list 23.15 (- 22 (/ m 2)))
			   p2 (list 24.25 (- 22 (/ m 2)))
		     )
		     (setq m1 (- 0 m))
		     (command "_.minsert" fileyx p1 1 1 "" n 1 m1)
		     (command "_.minsert" fileyx p2 1 1 "" n 1 m1)
		   )			;endprogn2
		 )			;end if2
	       )			;endprogn103 103 103 103
	     )				;end if103 03 103 103 103
	   )				;endprogn111111111111111111
	 )				;endif11111111111111111111111

       )				;endprogn1
      )					;3



      ((= yx "砾砂")
       (progn				;progn1
	 (setq m (- ks2 ks1))
	 (if (<= ks2 21)		;if2
	   (setq p1 (list 4.75 (- 22 ks1 (/ m 2)))
		 p2 (list 5.85 (- 22 ks1 (/ m 2)))
	   )
	 )				;end if2
	 (if (> ks1 21)
	   (setq p1 (list 23.15 (- 43 ks1 (/ m 2)))
		 p2 (list 24.25 (- 43 ks1 (/ m 2)))
	   )
	 )
	 (if (and (> ks2 21) (< ks1 21))
	   (progn
	     (setq m (- 21 ks1))
	     (setq p1 (list 4.975 (- 22 ks1 (/ m 2)))
		   p2 (list 5.85 (- 22 ks1 (/ m 2)))
	     )
	     (setq m (- ks2 21))
	     (setq p3 (list 23.15 (- 22 (/ m 2)))
		   p4 (list 24.25 (- 22 (/ m 2)))
	     )
	     (command "_.text" "s" "style1" "m" p3 0.16 0 "(L)")

	   )				;endprogn
	 )				;endif
	 (command "_.text" "s" "style1" "m" p1 0.16 0 "(L)")

       )				;end progn1	
      )					;6


      ((= yx "粗砂")
       (progn				;progn1
	 (setq m (- ks2 ks1))
	 (if (<= ks2 21)		;if2
	   (setq p1 (list 4.975 (- 22 ks1 (/ m 2)))
		 p2 (list 5.85 (- 22 ks1 (/ m 2)))
	   )
	 )				;end if2
	 (if (> ks1 21)
	   (setq p1 (list 23.15 (- 43 ks1 (/ m 2)))
		 p2 (list 24.25 (- 43 ks1 (/ m 2)))
	   )
	 )
	 (if (and (> ks2 21) (< ks1 21))
	   (progn
	     (setq m (- 21 ks1))
	     (setq p1 (list 4.975 (- 22 ks1 (/ m 2)))
		   p2 (list 5.85 (- 22 ks1 (/ m 2)))
	     )
	     (setq m (- ks2 21))
	     (setq p3 (list 23.15 (- 22 (/ m 2)))
		   p4 (list 24.25 (- 22 (/ m 2)))
	     )
	     (command "_.text" "s" "style1" "m" p3 0.16 0 "(c)")
	     (command "_.text" "s" "style1" "m" p4 0.16 0 "(c)")
	   )				;endprogn
	 )				;endif
	 (command "_.text" "s" "style1" "m" p1 0.16 0 "(c)")

       )				;end progn1	
      )					;6

      ((= yx "中砂")
       (progn				;progn1
	 (setq m (- ks2 ks1))
	 (if (<= ks2 21)		;if2
	   (setq p1 (list 4.975 (- 22 ks1 (/ m 2)))
		 p2 (list 5.85 (- 22 ks1 (/ m 2)))
	   )
	 )				;end if2
	 (if (> ks1 21)
	   (setq p1 (list 23.15 (- 43 ks1 (/ m 2)))
		 p2 (list 24.25 (- 43 ks1 (/ m 2)))
	   )
	 )
	 (if (and (> ks2 21) (< ks1 21))
	   (progn
	     (setq m (- 21 ks1))
	     (setq p1 (list 4.975 (- 22 ks1 (/ m 2)))
		   p2 (list 5.85 (- 22 ks1 (/ m 2)))
	     )
	     (setq m (- ks2 21))
	     (setq p3 (list 23.15 (- 22 (/ m 2)))
		   p4 (list 24.25 (- 22 (/ m 2)))
	     )
	     (command "_.text" "s" "style1" "m" p3 0.16 0 "(z)")
	     (command "_.text" "s" "style1" "m" p4 0.16 0 "(z)")
	   )				;endprogn
	 )				;endif

	 (command "_.text" "s" "style1" "m" p1 0.16 0 "(z)")

       )				;end progn1	
      )					;7

      ((= yx "细砂")
       (progn				;progn1
	 (setq m (- ks2 ks1))
	 (if (<= ks2 21)		;if2
	   (setq p1 (list 4.975 (- 22 ks1 (/ m 2)))
		 p2 (list 5.85 (- 22 ks1 (/ m 2)))
	   )
	 )				;end if2
	 (if (> ks1 21)
	   (setq p1 (list 23.15 (- 43 ks1 (/ m 2)))
		 p2 (list 24.25 (- 43 ks1 (/ m 2)))
	   )
	 )
	 (if (and (> ks2 21) (< ks1 21))
	   (progn
	     (setq m (- 21 ks1))
	     (setq p1 (list 4.975 (- 22 ks1 (/ m 2)))
		   p2 (list 5.85 (- 22 ks1 (/ m 2)))
	     )
	     (setq m (- ks2 21))
	     (setq p3 (list 23.15 (- 22 (/ m 2)))
		   p4 (list 24.25 (- 22 (/ m 2)))
	     )
	     (command "_.text" "s" "style1" "m" p3 0.16 0 "(x)")
	     (command "_.text" "s" "style1" "m" p4 0.16 0 "(x)")
	   )				;endprogn
	 )				;endif
	 (command "_.text" "s" "style1" "m" p1 0.16 0 "(x)")

       )				;end progn1	
      )					;8

      ((= yx "粉砂")
       (progn				;progn1
	 (setq m (- ks2 ks1))
	 (if (<= ks2 21)		;if2
	   (setq p1 (list 4.975 (- 22 ks1 (/ m 2)))
		 p2 (list 5.85 (- 22 ks1 (/ m 2)))
	   )
	 )				;end if2
	 (if (> ks1 21)
	   (setq p1 (list 23.15 (- 43 ks1 (/ m 2)))
		 p2 (list 24.25 (- 43 ks1 (/ m 2)))
	   )
	 )
	 (if (and (> ks2 21) (< ks1 21))
	   (progn
	     (setq m (- 21 ks1))
	     (setq p1 (list 4.975 (- 22 ks1 (/ m 2)))
		   p2 (list 5.85 (- 22 ks1 (/ m 2)))
	     )
	     (setq m (- ks2 21))
	     (setq p3 (list 23.15 (- 22 (/ m 2)))
		   p4 (list 24.25 (- 22 (/ m 2)))
	     )
	     (command "_.text" "s" "style1" "m" p3 0.16 0 "(f)")
	     (command "_.text" "s" "style1" "m" p4 0.16 0 "(f)")
	   )				;endprogn
	 )				;endif
	 (command "_.text" "s" "style1" "m" p1 0.16 0 "(f)")

       )				;end progn1	
      )					;9

      ((or (= yx "根植土") (= yx "种植土"))
       (progn				;progn1
	 (setq fileyx (strcat "c:/Gees2000/岩土花纹/" yx))
	 (setq fileyx1 (strcat "c:/Gees2000/岩土花纹/" yx ".dwg"))
	 (if (findfile fileyx1)		;if1111111111111111111111111
	   (if (< (/ (- ks2 ks1) 1.3) 1) ;if1
	     (progn
	       (setq m (- ks2 ks1))
	       (if (< (+ ks1 (* m 0.5)) 21) ;if2
		 (setq p1 (list 4.975 (- 22 ks1 0.1))
		       p2 (list 5.85 (- 22 ks1 0.1))
		 )
		 (setq p1 (list 23.15 (- 43 ks1 0.1))
		       p2 (list 24.25 (- 43 ks1 0.1))
		 )
	       )			;end if2
	       (command "_.insert" "d:/1/根植土" p1 0.8 0.8 "")
	       (command "_.insert" "d:/1/根植土" p2 0.8 0.8 "")
	     )				;endprogn
	     (progn			;progn2
	       (setq i 0)
	       (setq m (/ (- ks2 ks1) (fix (/ (- ks2 ks1) 1.3))))
	       (repeat (fix (/ (- ks2 ks1) 1.3))
		 (setq i (1+ i))
		 (if (< (+ ks1 (* m i)) 21) ;if2
		   (setq p1 (list 4.975 (- 22 ks1 (* m i) (- (/ m 2))))
			 p2 (list 5.85 (- 22 ks1 (* m i) (- (/ m 2))))
		   )
		   (setq p1 (list 23.15 (- 43 ks1 (* m i) (- (/ m 2))))
			 p2 (list 24.25 (- 43 ks1 (* m i) (- (/ m 2))))
		   )
		 )			;end if2
		 (command "_.insert" "d:/1/根植土" p1 0.8 0.8 "")


	       )			;repeat
	     )				;endprogn2
	   )				;end if1
	 )				;endif111111111111111111111111
       )				;progn1
      )					;12
      (t (setq yx nil))
    )					;end cond '("全风化"	  "强风化"   "中风化"	"弱风化"   "微风化"  "粗砂"	  "中砂"     "细砂"	"粉砂"	   "晶屑"   "熔结" "根植土" "种植土")
					;end cond '("全风化"	  "强风化"   "中风化"	"弱风化"   "微风化"  "粗砂"	  "中砂"     "细砂"	"粉砂"	   "晶屑"   "熔结" "根植土" "种植土")
    (setq yx nil)
    (setq yx (apply 'qdyx (list '("晶屑") yxms)))
    (if	(= yx "晶屑")
      (progn				;progn1
	(if (< (/ (- ks2 ks1) 0.6) 1)	;if1
	  (progn
	    (setq m (- ks2 ks1))
	    (if	(< (+ ks1 (* m 0.5)) 21) ;if2
	      (setq p1 (list 4.925 (- 22 ks1 (/ m 2)))
		    p2 (list 5.85 (- 22 ks1 (/ m 2)))
	      )
	      (setq p1 (list 23.15 (- 43 ks1 (/ m 2)))
		    p2 (list 24.25 (- 43 ks1 (/ m 2)))
	      )
	    )				;end if2
	    (command "_.text" "s" "style1" "m" p1 0.16 0 "J")

	  )				;endprogn
	  (progn			;progn2
	    (setq i  0
		  PY 0.2
	    )
	    (setq m (/ (- ks2 ks1) (fix (/ (- ks2 ks1) 0.6))))
	    (repeat (fix (/ (- ks2 ks1) 0.6))
	      (setq i (1+ i))
	      (setq PY (- 0 PY))
	      (if (< (+ ks1 (* m i)) 21) ;if2
		(setq p1 (list (- 4.75 PY) (- 22 ks1 (* m i) (- (/ m 2))))
		      p2 (list (- 5.85 PY) (- 22 ks1 (* m i) (- (/ m 2))))
		)
		(setq p1 (list (- 23.15 PY) (- 43 ks1 (* m i) (- (/ m 2))))
		      p2 (list (- 24.25 PY) (- 43 ks1 (* m i) (- (/ m 2))))
		)
	      )				;end if2
	      (if (< (cadr p1) 22)
		(progn (command "_.text" "s" "style1" "m" p1 0.16 0 "J")

		)
	      )

	    )				;repeat
	  )				;endprogn2
	)				;end if1

      )					;progn1
    )					;end if "晶屑"
    (setq yx nil)
    (setq yx (apply 'qdyx (list '("熔结") yxms)))
    (if	(= yx "熔结")
      (progn				;progn1
	(if (< (/ (- ks2 ks1) 0.6) 1)	;if1
	  (progn
	    (setq m (- ks2 ks1))
	    (if	(< (+ ks1 (* m 0.5)) 21) ;if2
	      (setq p1 (list 4.725 (- 22 ks1 (/ m 2)))
		    p2 (list 5.6 (- 22 ks1 (/ m 2)))
	      )
	      (setq p1 (list 22.9 (- 43 ks1 (/ m 2)))
		    p2 (list 24 (- 43 ks1 (/ m 2)))
	      )
	    )				;end if2
	    (command "_.text" "s" "style1" "m" p1 0.16 0 "ω")

	  )				;endprogn
	  (progn			;progn2
	    (setq i   0
		  PY  0.2
		  ant 0
	    )
	    (setq m (/ (- ks2 ks1) (fix (/ (- ks2 ks1) 0.6))))
	    (repeat (fix (/ (- ks2 ks1) 0.6))
	      (setq i (1+ i))
	      (setq PY	(- 0 PY)
		    ant	(+ ant 33)
	      )
	      (if (< (+ ks1 (* m i)) 21) ;if2
		(setq p1 (list (+ 4.75 PY) (- 22 ks1 (* m i) (- (/ m 2))))
		      p2 (list (+ 5.85 PY) (- 22 ks1 (* m i) (- (/ m 2))))
		)
		(setq p1 (list (+ 23.15 PY) (- 43 ks1 (* m i) (- (/ m 2))))
		      p2 (list (+ 24.25 PY) (- 43 ks1 (* m i) (- (/ m 2))))
		)
	      )				;end if2
	      (if (< (cadr p1) 22)
		(progn
		  (command "_.text" "s" "style1" "m" p1 0.16 ant "ω")
		  (command "_.text" "s" "style1" "m" p2 0.16 ant "ω")
		)
	      )

	    )				;repeat
	  )				;endprogn2
	)				;end if1

      )					;progn1
    )					;end if"熔结"

    (setq yx nil)
    (setq yx (apply 'qdyxm (list bzyxb3 yxms)))
    (setq myyx (apply 'tfmc(list yx)))
    (setq fileyx (strcat "c:/Gees2000/岩土花纹/" myyx))
    (setq fileyx1 (strcat "c:/Gees2000/岩土花纹/" myyx ".dwg"))
    (if	(findfile fileyx1)		;if1111111111111111111111111
      (progn				;progn111111111111
	(if (<= ks2 21)			;if101 101 101 101
	  (if (< (/ (- ks2 ks1) 0.45) 1.5) ;if1
	    (progn ;;progn1
		   (setq m (- ks2 ks1))
		   (setq p1 (list 4.525 (- 22 ks1 (/ m 2)))
			 p2 (list 5.625 (- 22 ks1 (/ m 2)))
		   )
		   (setq m2 (/ m 0.45))
		   (command "_.minsert" fileyx p1 1 m2 "" 1 3 0.45)

	    )				;endprogn1
	    (progn			;progn2
	      (setq n (fix (/ (- ks2 ks1) 0.45)))
	      (if (= n 1)
		(setq n 2)
	      )
	      (setq m (/ (- ks2 ks1) n))
	      (setq p1 (list 4.525 (- 22 ks1 (/ m 2)))
		    p2 (list 5.625 (- 22 ks1 (/ m 2)))
	      )
	      (setq m1 (- 0 m))
	      (setq m2 (/ m 0.45))
	      (command "_.minsert" fileyx p1 1 m2 "" n 3 m1 0.45)

	    )				;endprogn2
	  )				;end if1
	)				;end if101 101 101 101 101
	(if (>= ks1 21)			;if102 102 102 102 102 102
	  (if (< (/ (- ks2 ks1) 0.45) 1.5) ;if1
	    (progn ;;progn1
		   (setq m (- ks2 ks1))
		   (setq p1 (list 22.925 (- 43 ks1 (/ m 2)))
			 p2 (list 24.025 (- 43 ks1 (/ m 2)))
		   )
		   (setq m2 (/ m 0.45))
		   (command "_.minsert" fileyx p1 1 m2 "" 1 2 0.45)
		   (command "_.minsert" fileyx p2 1 m2 "" 1 2 0.45)
	    )				;endprogn1
	    (progn			;progn2
	      (setq n (fix (/ (- ks2 ks1) 0.45)))
	      (if (= n 1)
		(setq n 2)
	      )
	      (setq m (/ (- ks2 ks1) n))
	      (setq p1 (list 22.925 (- 43 ks1 (/ m 2)))
		    p2 (list 24.025 (- 43 ks1 (/ m 2)))
	      )
	      (setq m1 (- 0 m))
	      (setq m2 (/ m 0.45))
	      (command "_.minsert" fileyx p1 1 m2 "" n 2 m1 0.45)
	      (command "_.minsert" fileyx p2 1 m2 "" n 2 m1 0.45)
	    )				;endprogn2
	  )				;end if1
	)				;end if102  102 102 102 102
	(if (and (< ks1 21) (> ks2 21))	;if103 103 103 103)
	  (progn			;progn103 103 103 103
	    (if	(< (/ (- 21 ks1) 0.45) 1.5) ;if1
	      (progn ;;progn1
		     (setq m (- 21 ks1))
		     (setq p1 (list 4.525 (- 22 ks1 (/ m 2)))
			   p2 (list 5.625 (- 22 ks1 (/ m 2)))
		     )
		     (setq m2 (/ m 0.45))
		     (command "_.minsert" fileyx p1 1 m2 "" 1 3 0.45)

	      )				;endprogn1
	      (progn			;progn2
		(setq n (fix (/ (- 21 ks1) 0.45)))
		(if (= n 1)
		  (setq n 2)
		)
		(setq m (/ (- 21 ks1) n))
		(setq p1 (list 4.525 (- 22 ks1 (/ m 2)))
		      p2 (list 5.625 (- 22 ks1 (/ m 2)))
		)
		(setq m1 (- 0 m))
		(setq m2 (/ m 0.45))
		(command "_.minsert" fileyx p1 1 m2 "" n 3 m1 0.45)

	      )				;endprogn2
	    )				;end if1
	    (if	(< (/ (- ks2 21) 0.45) 1.5) ;if2
	      (progn ;;progn1
		     (setq m (- ks2 21))
		     (setq p1 (list 22.925 (- 22 (/ m 2)))
			   p2 (list 24.025 (- 22 (/ m 2)))
		     )
		     (setq m2 (/ m 0.45))
		     (command "_.minsert" fileyx p1 1 m2 "" 1 2 0.45)
		     (command "_.minsert" fileyx p2 1 m2 "" 1 2 0.45)
	      )				;endprogn1
	      (progn			;progn2
		(setq n (fix (/ (- ks2 21) 0.45)))
		(if (= n 1)
		  (setq n 2)
		)
		(setq m (/ (- ks2 21) n))
		(setq p1 (list 22.925 (- 22 (/ m 2)))
		      p2 (list 24.025 (- 22 (/ m 2)))
		)
		(setq m1 (- 0 m))
		(setq m2 (/ m 0.45))
		(command "_.minsert" fileyx p1 1 m2 "" n 2 m1 0.45)
		(command "_.minsert" fileyx p2 1 m2 "" n 2 m1 0.45)
	      )				;endprogn2
	    )				;end if2
	  )				;endprogn103 103 103 103
	)				;end if103 03 103 103 103
      )					;endprogn111111111111111111
    )					;endif11111111111111111111111
  )					;end defun huawentc(bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000000000000000000000000000
					;end defun huawentc(bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000000000000000000000000000
					;end defun huawentc(bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000000000000000000000000000
					;end defun huawentc(bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000000000000000000000000000
					;end defun huawentc(bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000000000000000000000000000
					;end defun huawentc(bzyxb3 yxms ks1 ks2)00000000000000000000000000000000000000000000000000000000000000000000000000











;;;;定义字体   
  (command "_.style" "style1" "楷体_GB2312" "" "" "" "" "" "")
  (command "_.style" "style11" "@楷体_GB2312" 0.23 "" "" "" "" "y")
  (command "_.style" "style2" "宋体" 0.23 "" "" "" "" "")
;;;;;从柱状图综合数据表zk中读出综合表zhb、孔深表ksb、岩性描述表yxmsb
;;;;;状态密度表ztmdb、含水量表hslb、承载力表czlb、摩阻力表mzlb、取样表qyb
;;;;;原位测试表ywcsb 
  (setq zhb nil)
  (setq ksb nil)
  (setq yxmsb nil)
  (setq ztmdb nil)
  (setq hslb nil)
  (setq czlb nil)
  (setq mzlb nil)
  (setq yzyb nil)
  (setq ldyb nil)
  (setq yyb nil)
  (setq bgb nil)
  (setq zeb nil)
  (setq fchb nil)
  (setq cyfhb nil)
  (setq i1 0)
  (if (= (nth i1 zk) "---0")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq zhb (append zhb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---0
  (if (= (nth i1 zk) "---1")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq ksb (append ksb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---1
  (if (= (nth i1 zk) "---2")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq yxmsb (append yxmsb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---2
  (if (= (nth i1 zk) "---3")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq fchb (append fchb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---2
  (if (= (nth i1 zk) "---4")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq cyfhb (append cyfhb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---2

  (if (= (nth i1 zk) "---5")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq ztmdb (append ztmdb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---3
  (if (= (nth i1 zk) "---6")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq hslb (append hslb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---4
  (if (= (nth i1 zk) "---7")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq czlb (append czlb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---5
  (if (= (nth i1 zk) "---8")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq mzlb (append mzlb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---6
  (if (= (nth i1 zk) "---9")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq yzyb (append yzyb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---7
  (if (= (nth i1 zk) "---10")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq ldyb (append ldyb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---8
  (if (= (nth i1 zk) "---11")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq bgb (append bgb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---9
  (if (= (nth i1 zk) "---12")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq zeb (append zeb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )					;end if---10



  (if (= (nth i1 zk) "---13")
    (progn				;progn0
      (setq i1 (1+ i1))
      (while (/= (substr (nth i1 zk) 1 3) "---") ;while0
	(setq yyb (append yyb (list (nth i1 zk))))
	(setq i1 (1+ i1))
	(setq abc (nth i1 zk))
      )					;end while0
    )					;end progn0
  )


;;;;;;;;;draw zzt
;;;;;;;;;draw zzt
;;;;;;;;;draw zzt
;;;;;;;;;draw zzt
;;;;;;;;;draw zzt
;;;;;;;;;draw zzt
;;;;;;;;;draw zzt
;;;;;;;;;draw zzt
;;;;;;;;;draw zzt
;;;;;;;;;draw zzt
;;;;;;;;;draw zzt
;;;;;;;;;draw zzt
  (setq gcmc (nth 0 zhb))

  (setq kh1 (nth 1 zhb))

  (setq kg (nth 4 zhb))
  (if (= kg nil)
    (setq kg "0")
  )

  (setq bl (nth 11 zhb))
  (if (or (= bl nil) (= (atof bl) 0))
    (setq bl "100")
  )

  (setq x (nth 2 zhb))

  (setq y (nth 3 zhb))

  (setq kn (nth 5 zhb))

  (setq Ky (nth 6 zhb))

  (setq kt (nth 7 zhb))

  (setq zn (nth 8 zhb))

  (setq zy (nth 9 zhb))

  (setq zt (nth 10 zhb))

  (setq lczh (nth 14 zhb))

  (setq n 1)
  (repeat (- (length ksb) 1)		;repeat1
    (progn				;progn1
      (setq ks (atof (nth n ksb)))
      (setq cyks (/ (+ ks (atof (nth (1- n) ksb))) 2))
      (if (>= (- 22 (/ ks (/ (atof bl) 100))) 1) ;if2
	(progn				;progn3
	  (setq p0 (list 0.8 (- 22.3 (/ ks (/ (atof bl) 100)))))
	  (setq p1 (list 0.3 (- 22 (/ ks (/ (atof bl) 100)))))
	  (setq p2 (list 5.65 (- 22 (/ ks (/ (atof bl) 100)))))
	)				;end progn3
					;end progn4
      )					;end if2
      (command "_.pline" p1 "w" 0.013 "" p2 "")
      (setq tp1 (list 1  (- 22 (/ ks (/ (atof bl) 100)) -0.13)))
      (setq tp2 (list 2.3 (- 22 (/ ks (/ (atof bl) 100)) -0.13)))
      (setq tp3 (list 3.5 (- 22 (/ ks (/ (atof bl) 100)) -0.13)))
      (setq txt2p (- ks (atof (nth (- n 1) ksb))))
      (setq txt1 (rtos ks 2 2))
      (setq txt2 (rtos txt2p 2 2))
      (setq txt3 (rtos (- (atof kg) ks) 2 2))
      (command "_.text" "s" "style1" "j" "m" tp1 0.2 0 txt1)
      (command "_.text" "s" "style1" "j" "m" tp2 0.2 0 txt2)
      (command "_.text" "s" "style1" "j" "m" tp3 0.2 0 txt3)


      (setq n (+ 1 n))
    )					;progn1
  )					;end repeat
					;开始输入状态密度
					;开始输入状态密度
					;开始输入状态密度

;;;;;;以下部份为岩土花纹自动填充
;;;;;;以下部份为岩土花纹自动填充
;;;;;;以下部份为岩土花纹自动填充
;;;;;;以下部份为岩土花纹自动填充
;;;;;;以下部份为岩土花纹自动填充
;;;;;;以下部份为岩土花纹自动填充
;;;;;;以下部份为岩土花纹自动填充
;;;;;;以下部份为岩土花纹自动填充
;;;;;;以下部份为岩土花纹自动填充
;;;;;;以下部份为岩土花纹自动填充
;;;;;;以下部份为岩土花纹自动填充
;;;;;;以下部份为岩土花纹自动填充
;;;;;;以下部份为岩土花纹自动填充
;;;;;;以下部份为岩土花纹自动填充
;;;;;;以下部份为岩土花纹自动填充


  (setq i11 0)
  (repeat (1- (length ksb))		;repeat00000000000000000000000000000000000000000000
    (setq ks1p (atof (nth i11 ksb)))
    (setq ks1 (/ ks1p (/ (atof bl) 100)))
    (setq yxms (nth i11 yxmsb))
    (setq i11 (1+ i11))
    (setq ks2p (atof (nth i11 ksb)))
    (setq ks2 (/ ks2p (/ (atof bl) 100)))
    (apply 'huawentc (list bzyxb yxms ks1 ks2))
  )					;end repeat0000000000000000000000000000000000000000000000000



;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;
  
  					;end repeat000000000000000000000000000000000000000000


  
  					;end repeat000000000000000000000000000000000000000000



  
  					;end repeat000000000000000000000000000000000000000000





  (setq	i  0
	ch (/ (length bgb) 5)
  )
  (repeat ch				;repeat 00000000000000000000000000000
    (setq a (nth i bgb)
	  b (nth (1+ i) bgb)
	  c (nth (+ i 2) bgb)
    )
    (if	(= (nth 27 gcwzb) "1")
      (setq a (nth (+ i 4) bgb))
    )
    (setq i (+ i 5))
    (if	(and (/= b "") (/= c ""))
      (setq d (/ (+ (atof b) (atof c)) 2 (/ (atof bl) 100)))
      (setq d (/ (+ (atof b) (atof c)) (/ (atof bl) 100)))
    )					;end if
    (setq e (strcat b "～" c))
    (setq f (strcat "N=" a))
    (if	(< d 21)
      (setq p1	(list 5.7 (- 22 d))
	    p2	(list 15.3 (- 22 d))
	    p3	(list 16.6 (- 22 d))
	    tp1	(list 15.95 (- 22.15 d))
	    tp2	(list 15.95 (- 21.88 d))
      )
      (setq p1	(list 24.1 (- 43 d))
	    p2	(list 35.3 (- 43 d))
	    p3	(list 36.6 (- 43 d))
	    tp1	(list 35.95 (- 43.2 d))
	    tp2	(list 35.95 (- 42.8 d))
      )
    )					;endif
    (command "_.pline" p2 "w" 0.013 "" p3 "")
    (command "_.text" "s" "style1" "m" tp1 0.16 0 f)
    (command "_.text" "s" "style1" "m" tp2 0.16 0 e)
    (command)
    (setq p1p (list (car p1) (- (cadr p1) 0.15)))
    (if	(= (nth 3 gcwzb) "1")
      (if (findfile "c:/gees2000/岩土花纹/标贯.dwg")
	(command "_.insert"	     "c:/gees2000/岩土花纹/标贯.dwg"
		 p1		     1
		 1		     ""
		)
      )
    )
    ;;endif
    (command)
  )					;end repeat000000000000000000000000000000000000000000




  
  
  (setq	i  0
	ch (/ (length zeb) 5)
  )
  (repeat ch				;repeat 00000000000000000000000000000
    (setq a (nth i zeb)
	  b (nth (1+ i) zeb)
	  c (nth (+ i 2) zeb)
    )
    (if (= (nth 28 gcwzb)"1")(setq a (nth (+ i 4)zeb)))
    (setq aa a)
    (setq j1  1
	  j2  1
	  jcb ""
	  jcc ""
    )
    (while (< j1 (strlen a))
      (setq jca (substr a j1 2))
      (if (= jca "，")
	(setq jcb (strcat jcb (substr a j2 (- j1 j2))",")
	      jcc (substr a (+ 2 j1))
	      j2  (+ 2 j1)
	)
      )
;;;;end if
      (setq j1 (1+ j1))
    )
;;;;end while
    (setq a (strcat jcb jcc))
    (if (= a "")(setq a aa))   

    (setq i (+ i 5))
    (if	(and (/= b "") (/= c ""))
      (setq d (/ (+ (atof b) (atof c)) 2 (/ (atof bl) 100)))
      (setq d (/ (+ (atof b) (atof c)) (/ (atof bl) 100)))
    )					;end if
    (setq e (strcat b "～" c))
    (setq f (strcat "N'=" a))
    (if	(< d 21)
      (setq p1	(list 5.7 (- 22 d))
	    p2	(list 15.3 (- 22 d))
	    p3	(list 16.6 (- 22 d))
	    tp1	(list 15.95 (- 22.15 d))
	    tp2	(list 15.95 (- 21.88 d))
      )
      (setq p1	(list 24.1 (- 43 d))
	    p2	(list 35.3 (- 43 d))
	    p3	(list 36.6 (- 43 d))
	    tp1	(list 35.95 (- 43.2 d))
	    tp2	(list 35.95 (- 42.8 d))
      )
    )					;endif
    (command "_.pline" p2 "w" 0.013 "" p3 "")
    (cond
      ((< (strlen f) 14)
       (command "_.text" "s" "style1" "m" tp1 0.16 0 f)
      )
      ((and (> (strlen f) 13) (< (strlen f) 25))
       (progn
	 (setq fp1 (list (- (car tp1) 0.74) (- (cadr tp1)0.08)))
	 (setq fp2 (list (+ (car tp1) 0.74) (- (cadr tp1)0.08)))
	 (command "_.text" "s" "style1" "f" fp1 fp2 0.16 f)
       )
       ;;;endprogn
       )
       ((> (strlen f) 24)
	 (progn
         (setq j1 1 j2 0 jwz ())
	 (while (< j1 (strlen f))
	   (if (and (= (substr f j1 1)",")(> j1 (+ j2 18))(< j1 (+ j2 26)))
	     (setq j2 j1 jwz (append jwz (list j1)))
	     );;;endif
	   (setq j1 (1+ j1))
	   );;;;;end while
	 (if (/= (length jwz)0)
	   (progn
	     (setq txt1 (substr f 1 (nth 0 jwz)))
	     (setq fp1 (list (- (car tp1)0.74)(+ (cadr tp1)(* (length jwz)0.2)-0.08)))
	     (setq fp2 (list (+ (car tp1)0.74)(+ (cadr tp1)(* (length jwz)0.2)-0.08)))
	     (command "_.text" "s" "style1" "f" fp1 fp2 0.16 txt1)
	     (setq j 1)
	     (repeat (1- (length jwz))
	       (setq txt1 (strcat "   "(substr f (1+(nth 0 jwz)) (-(nth j jwz)(nth 0 jwz)))))
	       (setq fp1 (list (- (car tp1)0.74)(+ (cadr tp1)(* (-(length jwz)j)0.2)-0.08)))
	       (setq fp2 (list (+ (car tp1)0.74)(+ (cadr tp1)(* (-(length jwz)j)0.2)-0.08)))
	       (command "_.text" "s" "style1" "f" fp1 fp2 0.16 txt1)
	       (setq j (1+ j))
	      );;;endrepeat
	     );;;endprogn
	     (progn
	       (setq txt1 f)
	       (setq fp1 (list (- (car tp1)0.74)(- (cadr tp1)0.08)))
	       (setq fp2 (list (+ (car tp1)0.74)(- (cadr tp1)0.08)))
	       (command "_.text" "s" "style1" "f" fp1 fp2 0.16 txt1)
	     );;;;endprogn
	   );;;endif
	 (if (/= (length jwz)0)
	   (progn
	    (setq txt1 (strcat "   "(substr f (1+(last jwz)))))
	    (setq fp1 (list (- (car tp1)0.74)(- (cadr tp1)0.08)))
	    (setq fp2 (list (+(- (car tp1)0.74)(* 0.062 (strlen txt1)))(- (cadr tp1)0.08)))
	    (command "_.text" "s" "style1" "f" fp1 fp2 0.16 txt1)
	    );;;endprogn
	   );;;endif
	 )
;;;;;end progn
       )
    )
    (command "_.text" "s" "style1" "m" tp2 0.16 0 e)
    (command)
    (setq p1p (list (car p1) (+ (cadr p1) 0.12)))
    (setq p1e (list (car p1) (- (cadr p1) 0.15)))
    (if	(= (nth 4 gcwzb) "1")
      (if (findfile "c:/gees2000/岩土花纹/重2.dwg")
	(command "_.insert"	      "c:/gees2000/岩土花纹/重2.dwg"
		 p1		      1
		 1		      ""
		)
      )
    )
;;;end if
    (command)
  )					;end repeat000000000000000000000000000000000000000000

;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;
					;end repeat000000000000000000000000000000000000000000

;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;


)					;enddefun zzt1fun(zk bzyxb)*******************************************************************************************************

					;enddefun zzt1fun(zk bzyxb)*******************************************************************************************************
					;enddefun zzt1fun(zk bzyxb)*******************************************************************************************************

					;enddefun zzt1fun(zk bzyxb)*******************************************************************************************************

					;enddefun zzt1fun(zk bzyxb)*******************************************************************************************************



(setq filename0 "c:/Gees2000/标准岩土名称.txt")
(setq bzyxb (apply 'getbzyxb (list filename0)))

(setq
  filename1 (nth 0 (apply 'readfile1 (list "c:/Gees2000/gcwz.txt")))
)
(setq listname1 "**zzt")
(setq zzt (apply 'readfile (list filename1 listname1)))



(setq
  filename3 (nth 0 (apply 'readfile1 (list "c:/Gees2000/gcwz.txt")))
)



(defun previewzzt ()
  (setq l00 (length zzt))
(setq pmh 10000)



  (setq	i 0
	j 0
  )
  (while (< i (length zzt))
    (if	(= (nth i zzt) "---zzt")
      (setq j (1+ j))
    )
    (setq i (1+ i))
  )					;end whille
  (setq zym (1- j))









  (setq	i 0
	j 0
  )
  (while (and (< j zzth) (< i (length zzt)))
    (setq i00 i)
    (if	(= (nth i zzt) "---zzt")
      (setq j (1+ j))
    )
    (setq i (1+ i))
  )					;end whille


  (if (< i00 (1- l00))
;;;if0000000000000000000000000000000000000
    (progn
;;;progn000000000000000000000000000000000000000000000

      (setq d (nth i00 zzt))
      (if (= (nth i00 zzt) "---zzt")
	(setq j00 t
	      a	nil
	      b	nil
	)
      )
      (setq i00 (1+ i00))
      (setq zkmc1 ""
	    zkmc2 ""
      )
      (setq d (nth i00 zzt))
      (while (and (/= (nth i00 zzt) "---zzt") (< i00 l00))
					;while111111
	(setq e (nth i00 zzt))
	(if j00				;if j
	  (progn			;progn1
	    (setq listname3 (strcat "**" (nth i00 zzt)))
	    (setq
	      j00 nil
	    )


	    (setq zk1 (apply 'readfile (list filename3 listname3)))
	    (apply 'zzttkfun (list zk1))
	    (setq zkmc1 (nth 2 zk1))
	    (setq gcmc (nth 1 zk1))
	    (apply 'zzt1fun (list zk1 bzyxb))
	  )				;end progn1
	  (progn			;progn2
	    (setq listname3 (strcat "**" (nth i00 zzt)))
	    (setq zk2 (apply 'readfile (list filename3 listname3)))
	    (setq zkmc2 (nth 2 zk2))
	    (apply 'zzt2fun (list zk2 bzyxb))
	  )				;end progn2
	)				;end if j
	(setq i00 (1+ i00))
      )					;end while11111111


      (setq gcml (nth 30 gcwzb))
      (setq txt1 (strcat gcml gcmc "--" zkmc1 " " zkmc2 "(" tjymh ")"))

      (setq txt1 (strcat "c:/Gees2000/福建省第四地质大队岩土工程勘察专家系统/gcrtf/ " zkmc1 " " zkmc2 "(" tjymh")"))

      (command
	"_.saveas"
	""
	txt1
	"y"
      )
      (command)




    )
;;;end progn0000000000000000000000000000000000000
    (progn
;;;progn111111111111111111111
      (command "_.point" "-10,-20")
      (command "_.point" "-10,20")
      (command "_.point" "50,20")
      (command "_.point" "50,-20")
      (command "_.zoom" "e")
      (setq tp1 '(20 0))
      (setq txt1 "该 页 柱 状 图 不 存 在！")
      (command "_.color" 1)
      (command "_.text" "s" "style1" "m" tp1 2.8 0 txt1)
      (command "_.color" "bylayer")
    )
;;;end progn111111111111111111111
  )
;;;end if00000000000000000000000000000000000000000
  (setq	p001 '(0 0)
	p002 '(16.95 26)
  )
)					;end defun previewzzt

