(if fn
(setq fn (getfiled "渗流结果文件名" fn "" 2))
(setq fn (getfiled "渗流结果文件名" "" "" 2)))
(setq f (open fn "r"))
(setq md (read-line f))
(while (/= (substr md 25 8) "单元总数")
(setq md (read-line f))
);定位单元总数
(setq dyzs (atoi (substr md 58 5)));读单元总数
(setq md (read-line f))
(setq jdzs (atoi (substr md 58 5)));读节点总数
(setq md (read-line f))
(setq clh (atoi (substr md 58 5)));读材料总数
(setq m 0)
(repeat clh
(setq m (+ 1 m))
(setq tcm (strcat "zclh" (itoa m)))
(command "layer" "m" tcm "c" (itoa m) tcm "")
);按材料种类生成图层名称
(setq m 0 n 0)
(repeat dyzs;对单元循环,dycfb中存放单元信息
(setq m (+ m 1))
(setq clh (nth 0 (nth m dycfb)))
(setq jdh1 (nth 1 (nth m dycfb)))
(setq jdh2 (nth 2 (nth m dycfb)))
(setq jdh3 (nth 3 (nth m dycfb)))
(setq jdh4 (nth 4 (nth m dycfb)))
(command "layer" "s" (strcat "zclh" (itoa clh)) "")
(command "pline";绘制单元网格
(nth jdh1 jdzbb)
(nth jdh2 jdzbb)
(nth jdh3 jdzbb)
(nth jdh4 jdzbb) "c")
(setq bzdzb (mapcar '+ (nth jdh1 jdzbb) (nth jdh2 jdzbb)
(nth jdh3 jdzbb) (nth jdh4 jdzbb)))
(setq bzdzb (list (/ (car bzdzb) 4.0) (/ (cadr bzdzb) 4.0)))
(command "text" "m" bzdzb "0.5" "0" (itoa m))