- (defun c:dcl2lsp (/ fname1 fn1 fname2 fn2 k fn1l fn2l)
- (setq fname1 (getfiled "Select DCL file" "" "dcl" 16))
- (setq fn1 (open fname1 "r"))
- (setq fname2 (getfiled "File to save" "" "lsp" 1))
- (setq fn2 (open fname2 "w"))
- (write-line "(defun writedcl (fn)" fn2);_增加个函数定义
- (while (setq fn1l (read-line fn1))
- (setq fn2l fn1l)
- (setq k 0)
- (while (setq k (vl-string-search """ fn2l k))
- (setq fn2l (vl-string-subst "\\"" """ fn2l k))
- (setq k (+ k 2))
- )
- (setq fn2l (strcat "(write-line "" fn2l "" fn)"))
- (write-line fn2l fn2)
- )
- (write-line ")" fn2)
- (close fn1)
- (close fn2)
- (princ)
- )
|