- 积分
- 11683
- 明经币
- 个
- 注册时间
- 2011-9-17
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
本帖最后由 树櫴希德 于 2019-6-13 12:48 编辑
begin,1020
-45,12
-40,15
-35,22
-30,15
-25,3
-15,10
-8,6
0,9
3,15
16,22
26,16
33,14
45,22
begin,1040
-50,23
-45,36
-40,15
-35,20
-30,15
-25,16
-20,18
-17,22
-10,16
0,22
8,6
15,2
19,12
25,14
31,21
40,26
48,33
50,30
;;;;;
1020,9
-45,3.0 -40,6.0 -35,13.0 -30,6.0 -25,-6.0 -15,1.0 -8,-3.0
0,0.0 3,6.0 16,13.0 26,7.0 33,5.0 45,13.0
1040,22
-45,3.0 -40,6.0 -35,13.0 -30,6.0 -25,-6.0 -15,1.0 -8,-3.0 -50,1.0 -45,14.0 -40,-7.0 -35,-2.0 -30,-7.0 -25,-6.0 -20,-4.0 -17,0.0 -10,-6.0
0,0.0 3,6.0 16,13.0 26,7.0 33,5.0 45,13.0 0,0.0 8,-16.0 15,-20.0 19,-10.0 25,-8.0 31,-1.0 40,4.0 48,11.0 50,8.0
- ;;测试 (f '(2 1 3 4 5 6 2 7 8 9 2 11 13 14 2) 2) ==>'((2 1 3 4 5 6) (2 7 8 9) (2 11 13 14) (2)) (substr (car l) 1 1)
- ;(setq pzx '( "520,12" "1314,14" "147,585" "0,14" "-148,52" "-525,474" "-41,565"))
- (defun fast1 (l a / b c)
- (while l
- (if (= a (substr (car l) 1 1))
- (progn (if b
- (setq c (cons (reverse b) c)
- b nil
- )
- )
- (setq b (cons (car l) b)
- l (cdr l)
- )
- (while (and l (/= a (substr (car l) 1 1)))
- (setq b (cons (car l) b)
- l (cdr l)
- )
- )
- (setq c (cons (reverse b) c)
- b nil
- )
- )
- (progn (setq b (cons (car l) b)
- l (cdr l)
- )
- )
- )
- )
- (if b
- (setq c (cons (reverse b) c)
- b nil
- )
- )
- (reverse c)
- );;测试 (f '(2 1 3 4 5 6 2 7 8 9 2 11 13 14 2) 2) ==>'((2 1 3 4 5 6) (2 7 8 9) (2 11 13 14) (2))
- (gc)
- (vl-load-com)
- ;;;;;;;;;;;;;;;;;;;
- (defun str->pt (str)
- (XD::Pnt:SetZ
- (mapcar 'distof (cdr (String:Split str ",")))
- 0.
- )
- )
- ;;;;;;;;;;;
- (defun String:Split (str delimiter / post strlst stl)
- (if str
- (progn
- (setq stl (strlen delimiter))
- (while (vl-string-search delimiter str)
- (setq post (vl-string-search delimiter str)
- strlst (cons (substr str 1 post) strlst)
- str (substr str (+ 1 post stl))
- )
- )
- (reverse (vl-remove "" (cons str strlst)))
- )
- )
- )
- ;;;;;;;;;;;;;;
- (defun c:casstoWD( / fn f fnn ff l ll pzx zh xb dmgc taitou x y z juli julia gcc gcca lll llla llll lllla)
- (setq fn (getfiled "Select Log file请选取南方CASS横断面数据文件:" "" "hdm" 8))
- (setq f (open (findfile fn) "r"))
- (while (setq l (read-line f))
- (setq ll (cons l ll ) )
- )
- (close f)
- (setq pzx (fast1(reverse ll) "b") )
- (setq ff(open(getfiled "建立纬地数据?数据文件" "C:\\" "txt" 36)"a"))
- (foreach x pzx
- (setq zh (car(cdr(String:Split (car x) "," ))))
- (setq xb (fast1 (cdr x) "0"))
- (setq dmgc (distof(car(cdr(String:Split(car(cadr xb)) ",")))1))
- (SETQ TAITOU (strcat zh ","(car(cdr(String:Split(car(cadr xb)) ","))) ) )
- (write-line TAITOU ff)
-
- (foreach y (car xb)
- (setq juli (car(String:Split y ",")))
- (setq gcc(distof (cadr (String:Split y ",") )1))
- (setq lll (strcat juli "," (vl-prin1-to-string (- gcc dmgc)) " " ) )
- (setq llll (cons lll llll))
- )
- (write-line (apply 'strcat (reverse llll)) ff)
- (foreach z (cadr xb)
- (setq julia (car(String:Split z ",")))
- (setq gcca(distof (cadr (String:Split z ",") )1))
- (setq llla (strcat julia "," (vl-prin1-to-string (- gcca dmgc)) " " ))
- (setq lllla (cons llla lllla))
- )
- (write-line (apply 'strcat (reverse lllla)) ff)
-
- )
- (close ff)
- ;(fast1(cdar(fast1(reverse ll) "b") ) "0")
- ;(fast1(car(fast1(reverse ll) "b") ) "0")
- ;(("begin,1020" "-45,12" "-40,15" "-35,22" "-30,15" "-25,3" "-15,10" "-8,6")
- ;("0,9" "3,15" "16,22" "26,16" "33,14" "45,22"))
- ;命令: (fast1(cdar(fast1(reverse ll) "b") ) "0")
- ;(("-45,12" "-40,15" "-35,22" "-30,15" "-25,3" "-15,10" "-8,6") ("0,9" "3,15"
- ;"16,22" "26,16" "33,14" "45,22"))
- )
|
|