Hi Alls,
I have plan to open a lsp file,with autolisp program,but I still confuse how to open a lsp file without touch of visual lisp editor.
(defun c:test (/ dcl_id file_folder all_file_name name lst ans sf nf xf ?f file)
(setq dcl_id (load_dialog "Display File Name.dcl"))
(if
(not (new_dialog "dfn" dcl_id))
(exit)
) ; if
(vl-load-com)
(setq file_folder "D:/YBI/Program/AutoLisp/Lisp program/My Alls Program")
(setq all_file_name (cddr (vl-directory-files file_folder)))
(setq all_file_name
(mapcar '(lambda (x)(nth x all_file_name))
(vl-sort-i all_file_name '<)))
(foreach file_name all_file_name
(setq name (cons (substr file_name 6 50) name))
) ; foreach
(setq lst (acad_strlsort (reverse name)))
(start_list "lb")
(mapcar 'add_list lst)
(end_list)
(mode_tile "lb" 2)
(action_tile
"lb"
"(setq data_name (nth (atoi $value) lst)) ")
(action_tile "accept" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)")
(setq ans (start_dialog))
(unload_dialog dcl_id)
(if
(= ans 1)
(progn
(setq sf data_name)
(foreach x all_file_name
(setq nf x)
(setq xf (vl-string-right-trim sf nf))
(setq ?f (vl-string-left-trim xf nf))
(if
(= ?f sf)
(setq file nf)
) ; if
) ; foreach
;(alert (strcat "\nThe file you seacrh is = " file))
; from here I want open lsp file in vlide editor,data base on variable
; "file", I mean for more clear look at attach file,it choose "Edit Color.lsp",
; now in session visual lisp editor, "Edit Color.lsp" file should open.
) ; progn
(alert "\nNot yet selected list,please try again")
) ; if
(princ)
)