你是用lisp程序创建文件吗?还是用其它程序创建?
如果不能定位该文件位置,只有findfile函数搜索该文件,得到文件路径了
下面的函数是否对你有用?
函数fnsplitl:
(fnsplitl "C:\\Program Files\\ACAD2000\\111.dwg")返回
("C:\\Program Files\\ACAD2000\\" "111" ".dwg")
函数
;;
;; Find dwg name from path name.
;;
(defun parse_path( / a b c)
(setq a 1)
(while ( <= a (strlen path_name))
(if (is_lead_byte(ascii (substr path_name a 1)))
(progn
(setq a (1+ a))
)
(progn
(if (member (substr path_name a 1) '("/" "\\" ":"))
(setq b a)
)
(if (member (substr path_name a 1) '("."))
(setq c a)
)
)
)
(setq a (1+ a))
)
;; Remove path
(if b
(setq blk_name (strcase (substr path_name (1+ b))))
(setq blk_name (strcase path_name))
)
;; Remove extension (the last period and the letters following it).
(if (and c blk_name path_name)
(progn
;; calculate c with respect to the blk_name rather than path_name.
(setq c (- c (- (strlen path_name) (strlen blk_name))))
(setq blk_name (strcase (substr blk_name 1 (- c 1))))
)
)
);_defun