- UID
- 654840
- 积分
- 15
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2008-10-7
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
(defun C:WTCJ ()
(command "osnap" "off" )
(COMMAND "insert" "c:\\Temp\\AB线CD段EF隧道DZ-01-023孔.dwg" "0,0,0" "1" "1" "0")
(COMMAND "_explode" "all")
(COMMAND "_zoom" "e")
(princ "\n读取综合测井文件数据,绘制曲线。")
(if (setq FILE (getfiled "选择dat文件"
""
"dat"
4
)
)
(progn
;;读模式打开lsp文件
(setq A1 (open FILE "r"))
;;逐行读入
(while (/= A1 nil)
(setq STR (repeat 2 (read-line F1)))
(if(= F1 "自然电位")
(progn
(setq min1 (getreal "请输入自然电位最小值"))
(setq max1 (getreal "请输入自然电位最大值"))
(rtos (setq mid1 (/ max1 4)));转成字符串
(rtos (setq mid2 (/ max1 2)))
(rtos (setq mid3 (* (/ max1 4) 3)))
(setq mid (strcat mid1 " " mid2 " " mid3))
(command "text" "s" "BG_ST" "j" "bc" "110.012,2.375,0" "2.5" "90d" mid)
(setq STR (repeat 4 (read-line F1)));钻孔编号
(setq LST STR)
(command "text" "s" "BG_ST" "j" "bl" "-140.524,42.492,0" "3.6" "90d" LST);写图签
(setq len (strlen STR))
(setq LST1 (strcat(substr STR 1 1) " "))
(setq len (- len 1))
(if (/= len 0)
(progn
; (setq n 1)
(setq n (+ n 1))
(setq LST1 (strcat LST1 (substr LST1 n 1) " "))
(setq len (- len 1))
)
)
(command "text" "s" "BG_ST" "j" "bl" "90.960,48.634,0" "5.0" "90d" LST1);写标题
(setq STR (repeat 3 (read-line F1)));套管长度
(setq LST2 (strcat STR "m"))
(command "text" "s" "BG_ST" "j" "bl" "217.39,32.308,0" "2.5" "90d" LST2)
(atoi LST2)
(setq LST3 (* LST2 2));1:500故乘2
(setq pa1 (polar '(30.0 0.0) (* pi 1.5) LST3))
(setq pa2 (polar '(80.0 0.0) (* pi 1.5) LST3))
(setq pa3 (polar '(32.382 -2.608) (* pi 1.5) (- LST3 2)))
(setq pa4 (polar '(32.154 -2.608) (* pi 1.5) (- LST3 2)))
(command "pline" '(32.382 -2.608) pa3 "")
(command "pline" '(32.154 -2.608) pa4 "")
(command "pline" pa1 pa2 "")
(command "text" "s" "BG_ST" "j" "bc" "55,-116,0" "2.0" "90d" LST3)
(command "text" "s" "BG_ST" "j" "bc" "70,-116,0" "2.0" "90d" "套管")
(setq STR (read-line F1));测试日期
(command "text" "s" "BG_ST" "j" "mc" "-58.524,11.258,0" "2.4" "90d" STR)
(setq STR (repeat 2 (read-line F1)));钻孔标高
(setq LST4 (strcat STR "m"))
(command "text" "s" "BG_ST" "j" "bl" "103.604,32.308,0" "2.5" "90d" LST4)
(setq STR (repeat 140 (read-line F1)));测井数据152行
(atof STR);转成实数
(list STR);转到串行
(setq data1 (car STR))
(setq data2 (cadr STR))
(setq data11 (atof data1))
(setq data21 (atof data2))
(setq Y (* data11 -2));1:500计算Y坐标
(if(< data21 min1) (setq X 90))
(if(> data21 max1) (setq X 130))
(if(and (> data21 min1) (< data21 max1))
(setq X (+ (* (/ (- data21 min1) (- max1 min1)) 40) 90));min1<data21<max1时,X=[(data21-min1)/(max1-min1)]*40+90
(setq G1 '(X,Y))
)
(while (/= STR nil)
(line-line())
(command "layer" "s" "图层8" "")
(command "pline" G1 G2 "w" "0.0" "0.0")
(setq G1 G2)
)
(defun line-line (STR)
(progn
(setq STR (read-line F1))
(atof STR)
(list STR)
(setq data1 (car STR))
(setq data2 (cadr STR))
(setq data11 (atof data1))
(setq data21 (atof data2))
(setq Y (* data11 -2))
(if(< data21 min1) (setq X 90))
(if(> data21 max1) (setq X 130))
(if(and (> data21 min1) (< data21 max1))
(setq X (+ (* (/ (- data21 min1) (- max1 min1)) 40) 90))
(setq G2 '(X,Y))
)
)
)
))
)
))
(close A1)
(princ "\nOK!")
(prompt "\n********* << C:WTCJ >> *********")
)
问题:函数的功能是读测井曲线,并画在CAD图上。为什么会是参数类型错误呢?要怎么改? |
|