嗨,杰克·巴沙,这个Lisp程序干得好。我正在尝试从文件中查找lisp图形x部分。查看代码中的附加照片和注释。我附上地1和地2的2个数据文件
- ;xsection form file data
- (defun c:xsection( / fn fp lst l p1 p2 oldOSM )
- (COMMAND "_layer" "_m" "ground1" "_c" "8" "" "")
- (COMMAND "_layer" "_m" "ground2" "_c" "3" "" "")
- ; if we have a 2d ground line
- (COMMAND "_layer" "_m" "text_ground1" "_c" "8" "" "")
- (COMMAND "_layer" "_m" "text_ground2" "_c" "3" "" "")
- (COMMAND "_layer" "_m" "name of section" "_c" "1" "" "")
- (COMMAND "_layer" "_m" "datum" "_c" "1" "" "")
- (COMMAND "_layer" "_m" "scale" "_c" "1" "" "")
- (COMMAND "_layer" "_m" "Vertical lines" "_c" "140" "" "")
- (COMMAND "_layer" "_m" "Vertical yellow line" "_c" "2" "" "")
- (setq ns (getreal "\n give name of the section : "))
- (setq dtm (getreal "\n give datum elevetion : "))
- (setq scl(/ (getreal "\n give scale (100,200,500,etc) : ") 100))
- (setq ht(* 0.175 scl))
- (setq fn (getfiled "Select ASCII file for ground 1" "" "txt" 4))
- ;
- ; I want to add a command when i whant in second time to add ground 2
- ;ask me.Do you have another ground line (Y/N)
- ;When i answer Yes then load ASCII file for ground 2
- ;(setq fe (getfiled "Select ASCII file for ground 2" "" "txt" 4))
- ;And ask me to pick the inset point for the ground 2 like the photo
- ;Look the photo to see the insert point of ground 2
- (setq fp (open fn "r") lst '())
- (while (setq l (read-line fp))
- (setq lst (cons l lst))
- )
- (close fp)
- (setq lst (reverse lst))
- (setq oldOSM (getvar "osmode"))
- (setvar "osmode" 0)
- (command "._pline" "")
- (foreach item lst
- (if (/= item "")
- (command item)
- (command "" "._pline")
- )
- )
- (command "")
- (setvar "osmode" oldOSM)
- (princ)
- )
- ;
- ;write data to the table .(I need help for this)
- ;
你能帮我更新你的代码吗?
谢谢
地面1.txt
地面2.txt
|